Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-28 23:02:40 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-28 23:12:11 +0400
commit2b39214c4d8811b06545b83c4e42a7578266e2b1 (patch)
tree5cbddb26f8031ff94035f5aff2dc516a2d0359d9 /intern/cycles/kernel/kernel_path_state.h
parente369a5c48529864118d49222dde3d530d58ebeae (diff)
Cycles Volume Render: add support for overlapping volume objects.
This works pretty much as you would expect, overlapping volume objects gives a more dense volume. What did change is that world volume shaders are now active everywhere, they are no longer excluded inside objects. This may not be desirable and we need to think of better control over this. In some cases you clearly want it to happen, for example if you are rendering a fire in a foggy environment. In other cases like the inside of a house you may not want any fog, but it doesn't seem possible in general for the renderer to automatically determine what is inside or outside of the house. This is implemented using a simple fixed size array of shader/object ID pairs, limited to max 15 overlapping objects. The closures from all shaders are put into a single closure array, exactly the same as if an add shader was used to combine them.
Diffstat (limited to 'intern/cycles/kernel/kernel_path_state.h')
-rw-r--r--intern/cycles/kernel/kernel_path_state.h17
1 files changed, 1 insertions, 16 deletions
diff --git a/intern/cycles/kernel/kernel_path_state.h b/intern/cycles/kernel/kernel_path_state.h
index 2df8f56fd45..afca28fddcf 100644
--- a/intern/cycles/kernel/kernel_path_state.h
+++ b/intern/cycles/kernel/kernel_path_state.h
@@ -16,20 +16,6 @@
CCL_NAMESPACE_BEGIN
-typedef struct PathState {
- int flag;
- int bounce;
-
- int diffuse_bounce;
- int glossy_bounce;
- int transmission_bounce;
- int transparent_bounce;
-
-#ifdef __VOLUME__
- int volume_shader;
-#endif
-} PathState;
-
ccl_device_inline void path_state_init(KernelGlobals *kg, PathState *state)
{
state->flag = PATH_RAY_CAMERA|PATH_RAY_SINGULAR|PATH_RAY_MIS_SKIP;
@@ -40,8 +26,7 @@ ccl_device_inline void path_state_init(KernelGlobals *kg, PathState *state)
state->transparent_bounce = 0;
#ifdef __VOLUME__
- /* todo: this assumes camera is always in air, need to detect when it isn't */
- state->volume_shader = kernel_data.background.volume_shader;
+ kernel_volume_stack_init(kg, state->volume_stack);
#endif
}