Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_path.h
| Context not available. | |||||
| Ray *ray, | Ray *ray, | ||||
| VolumeStack *stack) | VolumeStack *stack) | ||||
| { | { | ||||
| #define MAX_VOLUME_HITS (VOLUME_STACK_SIZE) /* no *2 multiplication? */ | |||||
| kernel_assert(kernel_data.integrator.use_volumes); | kernel_assert(kernel_data.integrator.use_volumes); | ||||
| Ray volume_ray = *ray; | Ray volume_ray = *ray; | ||||
| Intersection isect; | |||||
| int step = 0; | |||||
| while(step < VOLUME_STACK_SIZE && | |||||
| scene_intersect_volume(kg, &volume_ray, &isect)) | |||||
| { | |||||
| ShaderData sd; | |||||
| shader_setup_from_ray(kg, &sd, &isect, &volume_ray, 0, 0); | |||||
| kernel_volume_stack_enter_exit(kg, &sd, stack); | |||||
| /* Move ray forward. */ | Intersection hits[MAX_VOLUME_HITS]; | ||||
| volume_ray.P = ray_offset(sd.P, -sd.Ng); | uint num_hits = scene_intersect_volume_all(kg, | ||||
| volume_ray.t -= sd.ray_length; | &volume_ray, | ||||
| ++step; | hits, | ||||
| MAX_VOLUME_HITS); | |||||
| if(num_hits > 0) { | |||||
| Intersection *isect = hits; | |||||
| for(uint hit = 0; hit < num_hits; ++hit, ++isect) { | |||||
| ShaderData sd; | |||||
| shader_setup_from_ray(kg, &sd, isect, &volume_ray, 0, 0); | |||||
| kernel_volume_stack_enter_exit(kg, &sd, stack); | |||||
| } | |||||
| } | } | ||||
| #undef MAX_VOLUME_HITS | |||||
| } | } | ||||
| #endif | #endif | ||||
| Context not available. | |||||