During preparing for using OptiX7 I went into this:
In this introduction sample code for an earlier OptiX version
“thePrdShadow” payload is used on the radiance ray type 0, although its the payload for ray type 1.
This could be ok, if the payload structure would have the “seed” element on exact same location in the struct.
But the https://github.com/nvpro-samples/optix_advanced_samples/blob/master/src/optixIntroduction/optixIntro_08/shaders/per_ray_data.h
defines the “seed” element on different position among the payload structs.
I would think here instead the radiance payload should be used with anyhit_cutout in a separate .cu file.
anyhit_cutout() (which is made for the radiance ray type) accesses “thePrdShadow” on ray type 0.
This would end up in accessing the first float of “absorption_ior” in PerRayData. The “seed” element there is not at first offset.
Am I wrong?
I know, its a demonstration sample; no production code; and so its up to the developer to adjust it; and for demonstration purpose it works, but I think updating the seed on anyhit there at least destroys one float of absorption_ior on those pixels.