Cycles Volume Render: add volume emission support.
This is done using the existing Emission node and closure (we may add a volume emission node, not clear yet if it will be needed). Volume emission only supports indirect light sampling which means it's not very efficient to make small or far away bright light sources. Using direct light sampling and MIS would be tricky and probably won't be added anytime soon. Other renderers don't support this either as far as I know, lamps and ray visibility tricks may be used instead.
This commit is contained in:
@@ -96,7 +96,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ra
|
||||
if(state.volume_stack[0].shader != SHADER_NO_ID) {
|
||||
Ray segment_ray = ray;
|
||||
segment_ray.t = (hit)? isect.t: FLT_MAX;
|
||||
throughput *= kernel_volume_get_shadow_attenuation(kg, &state, &segment_ray);
|
||||
kernel_volume_integrate(kg, &state, &segment_ray, L, &throughput);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -518,7 +518,7 @@ ccl_device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample,
|
||||
if(state.volume_stack[0].shader != SHADER_NO_ID) {
|
||||
Ray segment_ray = ray;
|
||||
segment_ray.t = (hit)? isect.t: FLT_MAX;
|
||||
throughput *= kernel_volume_get_shadow_attenuation(kg, &state, &segment_ray);
|
||||
kernel_volume_integrate(kg, &state, &segment_ray, &L, &throughput);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1022,7 +1022,7 @@ ccl_device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, in
|
||||
if(state.volume_stack[0].shader != SHADER_NO_ID) {
|
||||
Ray segment_ray = ray;
|
||||
segment_ray.t = (hit)? isect.t: FLT_MAX;
|
||||
throughput *= kernel_volume_get_shadow_attenuation(kg, &state, &segment_ray);
|
||||
kernel_volume_integrate(kg, &state, &segment_ray, &L, &throughput);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user