<p>This is called "<a href="https://graphics.stanford.edu/papers/deepshadows/deepshad.pdf" rel="nofollow noreferrer">deep shadow mapping</a>" and deep compositing.</p>

<p>Sadly invented long before you had this ideas yourself);</p>

<p>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.</p>

CC BY-SA 3.0
2017-02-05T10:27:08.100Z
2017-02-05T10:27:08.100Z
user18490
<p>I have an idea of how to render opaque rasterized geometry alongside raycast volumes:</p>

<ul>
<li>Render rasterized geometry to a depth map and also a render target</li>
<li>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</li>
</ul>

<p>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. </p>

<p>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. </p>

<p>How could I go about solving this?</p>

<raytracing><transparency><volumetric>
Volumetric raycasting with transparent rasterized geometry
Daniel
# Volumetric raycasting with transparent rasterized geometry

(Asked by: username_0 on 2017-02-04)

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?

**Tags:** raytracing, transparency, volumetric


---

## 1 answers

### Answer by username_1 on 2017-02-05. Score: 1

This is called "[deep shadow mapping](https://graphics.stanford.edu/papers/deepshadows/deepshad.pdf)" 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.


---

