Shadows and transparency

Started by
9 comments, last by matches81 18 years ago
hi, i have been reading alot about shadowmapping/stencil shadows lately. There is still one thing that i dont understand. What are transparent shadows ? Where can i see transparent shadows in action ? How can i implement it ? b
Advertisement
I might be wrong, but I always thought "transparent shadows" where the term used to describe when a shadowing technique supports casting shadows of transparent / semi-transparent objects, like dirty or even colored glass for example.
Quote:Original post by matches81
I might be wrong, but I always thought "transparent shadows" where the term used to describe when a shadowing technique supports casting shadows of transparent / semi-transparent objects, like dirty or even colored glass for example.


that sounds good to me.. do you have any information about implementation details ?
i would like to add decent shadows to a little game engine. so far i have simple shadow maps, but i am not realy happy with it (aliasing). Now i think about implementing shadow volumes but im not sure if its possible to get "transparent shadows" with shadow volumes (stencil shadows).

b

sry, I haven´t implemented any shadow technique yet personally. Only read theory (and loads of it) about it, so an answer from someone who already did transparent shadows (or any decent shadows at all) might be worth your time more than this one, but:
Getting transparent shadows with shadow volumes seems to be... rather unusual, at least I´ve never seen it done in a game. But I would think it should be possible to do so. You would most probably have to handle the shadow volume of transparent objects seperately and apply some sort of coloring to the shadows generated. Furthermore you would definitely get problems if you have something like church glass, with multiple colors or even a picture embedded. For that you would have to somehow project the texture of the transparent object onto the shadowed geometry.
For shadow maps: I´ve heard of something called "Deep Shadow Maps", which seems to be capable to realize transparent shadows, though I don´t know whether it´s efficient enough to be done in real-time. Furthermore I had read an article about doing transparent shadows with shadow maps, but that was quite a time ago and I don´t seem to remember where it was, sry.
This seems to have been able to do it. Scroll down to 'Transparent shadowmapping'.
Yes, I think that was the one I saw, though I would have sworn that I read an article, not "only" watched a demo and looked through some source-code.
The only thing about the demo and the short description of the technique used that makes me wonder is: How does this work with multiple transparent objects?
According to the short description and the source I´ve seen, the application renders the color of a transparent object into the RGB channels of a texture, and the depth of opaque objects into the A channel. So after doing the depth pass it ends up with a texture containing the RGB lightcolor (white for opaque objects and the color of transparent objects) and an 8-bit depth buffer (containing only the depths of opaque objects) stored in the A channel.
Imagine a scene like that from the demo there, but with a second glass of that making. The second glass pane would receive shadows from the first one, and would again change the light color there, so no problem with that (at least it could work when multiplying the colors), the first opaque face receiving light through those 2 glass panes would receive the correct color.
But what light color would be used for the second glass pane itself, as it should be lit?
I assume that with the technique described at Humus3D the complete ray of light would be colored the same, from its source to the first opaque face it hits, as there is only one depth information stored, being that of the first opaque face hit by the ray. So my assumption is, that this only works correctly if there is only one transparent object intersecting the ray.


thanks for all your input folks


:)

Transparent Shadows...

From lights point of view:
1. Calculate and store shadow matrix.
2. render depth of scene (excluding transparencies) to render target.
3. render depth and color of transparencies to render target.

From cameras point of view: PASS 02:

Dependant on how you render your shadows (i usually do it all in one pass);

after rendering your shadows with texture from (2),

render the color map dependant upon the transparencies depth value.

Quote:Original post by Lopez
Transparent Shadows...

From lights point of view:
1. Calculate and store shadow matrix.
2. render depth of scene (excluding transparencies) to render target.
3. render depth and color of transparencies to render target.

From cameras point of view: PASS 02:

Dependant on how you render your shadows (i usually do it all in one pass);

after rendering your shadows with texture from (2),

render the color map dependant upon the transparencies depth value.


So, how do you store color and depth for two transparent objects that occupy the same 'place' from the light´s point of view?
Quote:So, how do you store color and depth for two transparent objects that occupy the same 'place' from the light´s point of view?

I don't think that would be very possible while maintaining precision. Maybe deep shadow mapping is a solution but i haven't been able to find very much information on this

Personally i would just store color and depth information for the nearest transparent object and disconsider the second.

This topic is closed to new replies.

Advertisement