Blender Git Commit Log

Git Commits -> Revision c4fa047

Revision c4fa047 by Thomas Dinges (master)
July 9, 2013, 00:18 (GMT)
Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which returns the current ray bounce (0, 1, 2, 3...)
* This can be used to use different shaders for direct and indirect lighting and artificial effects.

Examples:
* http://www.pasteall.org/pic/show.php?id=55158 Here we use the output to apply a different shader to the third bounce. As in this example, you can use Math Nodes (Greater Than / Less Than) if you want to use values outside of the 0/1 range.

* http://www.pasteall.org/pic/show.php?id=55159 Here we restrict the maximum bounce on a per shader basis for the left sphere. This way it looks like we would only have 1 max bounce set in the scene "Light paths" panel.
This can be used to e.g. improve performance for objects far from the camera, which do not need full GI.

Technical notes:
* Implemented for both integrators and SVM/OSL.
* This is done by passing state.bounce to the shader_setup_from_* functions.
* Note: We don't pass state.bounce to kernel_shader_evaluate() and therefore shader_setup_from_displacement() method doesn't set the value, this is outside the path trace loop. Maybe a ToDo?

Commit Details:

Full Hash: c4fa0478943cd7c360908d0e1fa7d0a82f211d0c
SVN Revision: 58091
Parent Commit: 0b5b82b
Lines Changed: +56, -31

12 Modified Paths:

/intern/cycles/kernel/kernel_displace.h (+1, -1) (Diff)
/intern/cycles/kernel/kernel_emission.h (+10, -10) (Diff)
/intern/cycles/kernel/kernel_path.h (+13, -13) (Diff)
/intern/cycles/kernel/kernel_shader.h (+7, -4) (Diff)
/intern/cycles/kernel/kernel_types.h (+3, -0) (Diff)
/intern/cycles/kernel/osl/osl_services.cpp (+7, -1) (Diff)
/intern/cycles/kernel/osl/osl_services.h (+1, -0) (Diff)
/intern/cycles/kernel/shaders/node_light_path.osl (+3, -1) (Diff)
/intern/cycles/kernel/svm/svm_light_path.h (+1, -0) (Diff)
/intern/cycles/kernel/svm/svm_types.h (+2, -1) (Diff)
/intern/cycles/render/nodes.cpp (+7, -0) (Diff)
/source/blender/nodes/shader/nodes/node_shader_light_path.c (+1, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021