Cycles Volume Render: heterogeneous (textured) volumes support.
Volumes can now have textured colors and density. There is a Volume Sampling panel in the Render properties with these settings: * Step size: distance between volume shader samples when rendering the volume. Lower values give more accurate and detailed results but also increased render time. * Max steps: maximum number of steps through the volume before giving up, to protect from extremely long render times with big objects or small step sizes. This is much more compute intensive than homogeneous volume, so when you are not using a texture you should enable the Homogeneous Volume option in the material or world for faster rendering. One important missing feature is that Generated texture coordinates are not yet working in volumes, and they are the default coordinates for nearly all texture nodes. So until that works you need to plug in object texture coordinates or a world space position. This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.
This commit is contained in:
@@ -94,8 +94,9 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ra
|
||||
#ifdef __VOLUME__
|
||||
/* volume attenuation, emission, scatter */
|
||||
if(state.volume_stack[0].shader != SHADER_NO_ID) {
|
||||
ray.t = (hit)? isect.t: FLT_MAX;
|
||||
kernel_volume_integrate(kg, &state, &ray, L, &throughput);
|
||||
Ray volume_ray = ray;
|
||||
volume_ray.t = (hit)? isect.t: FLT_MAX;
|
||||
kernel_volume_integrate(kg, &state, &volume_ray, L, &throughput);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -462,7 +463,7 @@ ccl_device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample,
|
||||
int num_samples = 0;
|
||||
#endif
|
||||
|
||||
path_state_init(kg, &state);
|
||||
path_state_init(kg, &state, rng, sample);
|
||||
|
||||
/* path iteration */
|
||||
for(;; rng_offset += PRNG_BOUNCE_NUM) {
|
||||
@@ -515,8 +516,9 @@ ccl_device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample,
|
||||
#ifdef __VOLUME__
|
||||
/* volume attenuation, emission, scatter */
|
||||
if(state.volume_stack[0].shader != SHADER_NO_ID) {
|
||||
ray.t = (hit)? isect.t: FLT_MAX;
|
||||
kernel_volume_integrate(kg, &state, &ray, &L, &throughput);
|
||||
Ray volume_ray = ray;
|
||||
volume_ray.t = (hit)? isect.t: FLT_MAX;
|
||||
kernel_volume_integrate(kg, &state, &volume_ray, &L, &throughput);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -988,7 +990,7 @@ ccl_device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, in
|
||||
int aa_samples = 0;
|
||||
#endif
|
||||
|
||||
path_state_init(kg, &state);
|
||||
path_state_init(kg, &state, rng, sample);
|
||||
|
||||
for(;; rng_offset += PRNG_BOUNCE_NUM) {
|
||||
/* intersect scene */
|
||||
@@ -1018,8 +1020,9 @@ ccl_device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, in
|
||||
#ifdef __VOLUME__
|
||||
/* volume attenuation, emission, scatter */
|
||||
if(state.volume_stack[0].shader != SHADER_NO_ID) {
|
||||
ray.t = (hit)? isect.t: FLT_MAX;
|
||||
kernel_volume_integrate(kg, &state, &ray, &L, &throughput);
|
||||
Ray volume_ray = ray;
|
||||
volume_ray.t = (hit)? isect.t: FLT_MAX;
|
||||
kernel_volume_integrate(kg, &state, &volume_ray, &L, &throughput);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user