Have a inital ray cast shader which sends rays to each buffer
Then 3 shaders that performs their own custom scatter function and appends product ray to new buffers if they are not complet
This is to avoid branch divergence on materials and will unlock some async compute. It will also make the code more readable as it is an excuse to split code into multiple files (but this can be done anyways)
It's not necessarily faster than status quo and should therefore be heavily tested if implemented ...
This can also be extended to perform gradual bounce simulations in the future (caching rays)
Test sending rays to buffers (one per material).
Have a inital ray cast shader which sends rays to each buffer
Then 3 shaders that performs their own custom scatter function and appends product ray to new buffers if they are not complet
This is to avoid branch divergence on materials and will unlock some async compute. It will also make the code more readable as it is an excuse to split code into multiple files (but this can be done anyways)
It's not necessarily faster than status quo and should therefore be heavily tested if implemented ...
This can also be extended to perform gradual bounce simulations in the future (caching rays)