Fix T38710: volume render issue with transparent surfaces.
This commit is contained in:
@@ -120,6 +120,9 @@ ccl_device_inline float path_rng_1D(KernelGlobals *kg, RNG *rng, int sample, int
|
|||||||
/* Cranly-Patterson rotation using rng seed */
|
/* Cranly-Patterson rotation using rng seed */
|
||||||
float shift;
|
float shift;
|
||||||
|
|
||||||
|
/* using the same *rng value to offset seems to give correlation issues,
|
||||||
|
* we could hash it with the dimension but this has a performance impact,
|
||||||
|
* we need to find a solution for this */
|
||||||
if(dimension & 1)
|
if(dimension & 1)
|
||||||
shift = (*rng >> 16) * (1.0f/(float)0xFFFF);
|
shift = (*rng >> 16) * (1.0f/(float)0xFFFF);
|
||||||
else
|
else
|
||||||
|
@@ -536,12 +536,17 @@ ccl_device VolumeIntegrateResult kernel_volume_integrate_heterogeneous(KernelGlo
|
|||||||
ccl_device_noinline VolumeIntegrateResult kernel_volume_integrate(KernelGlobals *kg,
|
ccl_device_noinline VolumeIntegrateResult kernel_volume_integrate(KernelGlobals *kg,
|
||||||
PathState *state, ShaderData *sd, Ray *ray, PathRadiance *L, float3 *throughput, RNG *rng)
|
PathState *state, ShaderData *sd, Ray *ray, PathRadiance *L, float3 *throughput, RNG *rng)
|
||||||
{
|
{
|
||||||
|
/* workaround to fix correlation bug in T38710, can find better solution
|
||||||
|
* in random number generator later, for now this is done here to not impact
|
||||||
|
* performance of rendering without volumes */
|
||||||
|
RNG tmp_rng = cmj_hash(*rng, state->rng_offset);
|
||||||
|
|
||||||
shader_setup_from_volume(kg, sd, ray, state->bounce);
|
shader_setup_from_volume(kg, sd, ray, state->bounce);
|
||||||
|
|
||||||
if(volume_stack_is_heterogeneous(kg, state->volume_stack))
|
if(volume_stack_is_heterogeneous(kg, state->volume_stack))
|
||||||
return kernel_volume_integrate_heterogeneous(kg, state, ray, sd, L, throughput, rng);
|
return kernel_volume_integrate_heterogeneous(kg, state, ray, sd, L, throughput, &tmp_rng);
|
||||||
else
|
else
|
||||||
return kernel_volume_integrate_homogeneous(kg, state, ray, sd, L, throughput, rng);
|
return kernel_volume_integrate_homogeneous(kg, state, ray, sd, L, throughput, &tmp_rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Volume Stack
|
/* Volume Stack
|
||||||
|
Reference in New Issue
Block a user