Fix incorrect OSL raytype bits and add some comments.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 20 Feb 2018 13:36:50 +0000 (14:36 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 21 Feb 2018 16:56:26 +0000 (17:56 +0100)
intern/cycles/kernel/kernel_types.h
intern/cycles/render/osl.cpp

index aeb63b4a65ef01dd91f8dd2adc7d15490778d8dc..c26769341f0401c84610c9294ea061d3c88fd264 100644 (file)
@@ -347,12 +347,20 @@ enum PathRayFlag {
 
        PATH_RAY_ALL_VISIBILITY = ((1 << 14)-1),
 
-       PATH_RAY_MIS_SKIP               = (1 << 15),
-       PATH_RAY_DIFFUSE_ANCESTOR       = (1 << 16),
-       PATH_RAY_SINGLE_PASS_DONE       = (1 << 17),
-       PATH_RAY_SHADOW_CATCHER         = (1 << 18),
-       PATH_RAY_STORE_SHADOW_INFO      = (1 << 19),
-       PATH_RAY_TRANSPARENT_BACKGROUND = (1 << 20),
+       /* Don't apply multiple importance sampling weights to emission from
+        * lamp or surface hits, because they were not direct light sampled. */
+       PATH_RAY_MIS_SKIP                    = (1 << 14),
+       /* Diffuse bounce earlier in the path, skip SSS to improve performance
+        * and avoid branching twice with disk sampling SSS. */
+       PATH_RAY_DIFFUSE_ANCESTOR            = (1 << 15),
+       /* Single pass has been written. */
+       PATH_RAY_SINGLE_PASS_DONE            = (1 << 16),
+       /* Ray is behind a shadow catcher .*/
+       PATH_RAY_SHADOW_CATCHER              = (1 << 17),
+       /* Store shadow data for shadow catcher or denoising. */
+       PATH_RAY_STORE_SHADOW_INFO           = (1 << 18),
+       /* Zero background alpha, for camera or transparent glass rays. */
+       PATH_RAY_TRANSPARENT_BACKGROUND      = (1 << 19),
 };
 
 /* Closure Label */
index 5c5ac6e2be982e35a7d2c89115531a0696a44b32..9c107274305c8da3fdaa5dbc243e2c8a96e0c59e 100644 (file)
@@ -233,18 +233,22 @@ void OSLShaderManager::shading_system_init()
                        "glossy",                       /* PATH_RAY_GLOSSY */
                        "singular",                     /* PATH_RAY_SINGULAR */
                        "transparent",          /* PATH_RAY_TRANSPARENT */
+
                        "shadow",                       /* PATH_RAY_SHADOW_OPAQUE_NON_CATCHER */
                        "shadow",                       /* PATH_RAY_SHADOW_OPAQUE_CATCHER */
                        "shadow",                       /* PATH_RAY_SHADOW_TRANSPARENT_NON_CATCHER */
                        "shadow",                       /* PATH_RAY_SHADOW_TRANSPARENT_CATCHER */
 
                        "__unused__",
+                       "volume_scatter",       /* PATH_RAY_VOLUME_SCATTER */
+                       "__unused__",
+
                        "__unused__",
                        "diffuse_ancestor",     /* PATH_RAY_DIFFUSE_ANCESTOR */
                        "__unused__",
                        "__unused__",
-                       "__unused__",           /* PATH_RAY_SINGLE_PASS_DONE */
-                       "volume_scatter",       /* PATH_RAY_VOLUME_SCATTER */
+                       "__unused__",
+                       "__unused__",
                };
 
                const int nraytypes = sizeof(raytypes)/sizeof(raytypes[0]);