Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_volume.h
| Show First 20 Lines • Show All 576 Lines • ▼ Show 20 Lines | |||||
| /* get the volume attenuation and emission over line segment defined by | /* get the volume attenuation and emission over line segment defined by | ||||
| * ray, with the assumption that there are no surfaces blocking light | * ray, with the assumption that there are no surfaces blocking light | ||||
| * between the endpoints. distance sampling is used to decide if we will | * between the endpoints. distance sampling is used to decide if we will | ||||
| * scatter or not. */ | * scatter or not. */ | ||||
| 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, bool heterogeneous) | PathState *state, ShaderData *sd, Ray *ray, PathRadiance *L, float3 *throughput, RNG *rng, bool heterogeneous) | ||||
| { | { | ||||
| /* 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); | shader_setup_from_volume(kg, sd, ray); | ||||
| if(heterogeneous) | if(heterogeneous) | ||||
| return kernel_volume_integrate_heterogeneous_distance(kg, state, ray, sd, L, throughput, &tmp_rng); | return kernel_volume_integrate_heterogeneous_distance(kg, state, ray, sd, L, throughput, rng); | ||||
| else | else | ||||
| return kernel_volume_integrate_homogeneous(kg, state, ray, sd, L, throughput, &tmp_rng, true); | return kernel_volume_integrate_homogeneous(kg, state, ray, sd, L, throughput, rng, true); | ||||
| } | } | ||||
| /* Decoupled Volume Sampling | /* Decoupled Volume Sampling | ||||
| * | * | ||||
| * VolumeSegment is list of coefficients and transmittance stored at all steps | * VolumeSegment is list of coefficients and transmittance stored at all steps | ||||
| * through a volume. This can then later be used for decoupled sampling as in: | * through a volume. This can then later be used for decoupled sampling as in: | ||||
| * "Importance Sampling Techniques for Path Tracing in Participating Media" | * "Importance Sampling Techniques for Path Tracing in Participating Media" | ||||
| * | * | ||||
| ▲ Show 20 Lines • Show All 667 Lines • Show Last 20 Lines | |||||