I’d really like to hear your ideas about how to share the samples to mimic the slicing in a raymarch. I havn’t seen that done anywhere before. although I cant quite see how that would be done in a pixel shader unless there is some kind of buffer used in multiple passes.
Thats true if you are using the half angle slicing technique. What I am proposing is to not actually do half angle slicing for the shadows but do slicing for the density pass only (in that case you don’t even need half angle, just slice towards the camera) and then do the shadows in raymarching. If raymarching, you have do do shadow samples inbetween every density sample. If I do the slicing the density sample is done up front and overdraw and shadow samples are the main cost. It seems like in that case the shadow samples would be very similar to doing just a density sample. This matches with the big 0 cost like you say.
I’m close to testing. I’m actually first re-creating my slicing code in blueprint (mainly out of curiosity to see how it performs, especially when it comes to nativizing it and also because I want to be able to share this around without users having to compile plugins/modules etc). I’m up to the point where I’ve detected start and end intersection points and have written the box/plane intersection function. Now I just need to build the vertices and indexes.
You’re right in that there is no opportunity for early exit. I’ll get this working and see what the difference is.