The intersection function is a simplified, 2d version of the box intersection function found in the engine. When you want to do this in a loop, its a good practive to precompute the inverse ray direction.
This is the actual material. The intersection function is called in a loop, to advance the ray through the grid (pixels of the texture).
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Particle occlusion using scene depth from a cubemap. This is basically the same idea as how you would do shadows for a point light. Breakdown in the thread. 👇
A scene capture cube can be used to capture a depth map at the time of spawning the particle. Then the cubemap depth can be used to mask particles out per pixel or per sprite.