3
$\begingroup$

I have an idea of how to render opaque rasterized geometry alongside raycast volumes:

  • Render rasterized geometry to a depth map and also a render target
  • When raycasting, check position against the depth map. When the ray penetrates the opaque geometry, alpha blend its color (from the render target) with the current color "rolling sum" of the ray, and stop raycasting

This might even work for a single piece of transparent geometry (say a piece of glass in front of the raycast volume), but it will break down with multiple pieces of transparent geometry.

For example, imagine a red transparent quad in front of a raycast volume, and a green transparent quad behind the same volume. On the rasterized geometry pass, the render target will receive a yellow color (blend of the red and green of the quads). This yellow color will be alpha blended with every sample of the raycast volume, making it look as if the green quad was also in front of it. Ideally we would want to see a reddish volume with effectively no green.

How could I go about solving this?

$\endgroup$
1
$\begingroup$

This is called "deep shadow mapping" and deep compositing.

Sadly invented long before you had this ideas yourself);

Now you are talking about implementing this idea specifically on a given architecture (GPU). It's up to you to make it work for this given architecture, and if you have technical difficulties with that maybe you can ask a question on this forum again.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.