refactor path_ray_data
Currently the PRD contains some data that is unused/may be optimized:
struct PerRayData_pathtrace
{
mrf::spectrum::COLOR attenuation;
mrf::spectrum::COLOR result;
optix::float3 origin;
optix::float3 direction;
#ifdef MRF_RENDERING_MODE_SPECTRAL_MULTIPLEXED
float wavelength_offset;
#endif
mrf::spectrum::COLOR_B ior; // **CAN BE REMOVED (replaced by an int) USING AN ALL-IOR BUFFER**
int id_wavelength;
int backface; // **Unused**
unsigned int seed;
unsigned int num_sample;
optix::float2 offset_sampling; //cranley patterson
int depth;
bool countEmitted;
bool done;
bool is_inside;
int shadow_catcher;
};
The mrf::spectrum::COLOR_B ior;
is heavy and not really fully used. A better solution is to build a buffer containing all IORs (eta+kappa) and only store a indexed reference in the PRD. That implies additionnal "permanent" storage for the buffer but grealty reduces the memory bandwith usage for the PRD, which all thing considered, should significantly make the additionnal storage worth it.
Using such a buffer would also be useful for medium tracking, to store index of previous/futur medium in a memory friendly way.