Sign in to follow this  
jbizzler

Correct Lighting Through Transparency

Recommended Posts

I've been thinking about transparency lately. I can't find any algorithms on lighting properly through transparent things that don't involve global illumination. Anyone know of anything I can search for? I have an idea, but don't really know if it would be right and can't really think how to implement it either.

Share this post


Link to post
Share on other sites
Some shadow mapping techniques can handle participating media, particularly deep shadow maps. Variance shadow maps can as well with simple alpha blending although you'll have to be extra careful about light bleeding (i.e. the first overlapping shadow/receiver will be correct, after that it will overestimate to some extent).

Basically you want to look at some method of shadowing that models the visibility cumulative distribution function. Deep shadow maps, opacity shadow maps, variance shadow maps and convolution shadow maps all do this in similar ways (but with different basis choices), and can handle transparency with differing levels of performance and visual accuracy.

Share this post


Link to post
Share on other sites
That's the easy part. I mean, what about correct colors. Like, what if I want a green light to go through a stained glass windows? And what happes when you have two stained glass windows?

Share this post


Link to post
Share on other sites
Have a different shadow map for each color component (RGB). For "multiple" windows that are overlapping, that's just whether the shadow mapping method can handle that. VSM probably won't look very good due to only keeping two terms. Opacity and Deep will probably do fine, as will convolution shadow maps although the latter three will need a fair number of terms and probably be pretty slow.

Share this post


Link to post
Share on other sites
Quote:
Original post by AndyTX
Some shadow mapping techniques can handle participating media, particularly deep shadow maps. Variance shadow maps can as well with simple alpha blending although you'll have to be extra careful about light bleeding (i.e. the first overlapping shadow/receiver will be correct, after that it will overestimate to some extent).

Basically you want to look at some method of shadowing that models the visibility cumulative distribution function. Deep shadow maps, opacity shadow maps, variance shadow maps and convolution shadow maps all do this in similar ways (but with different basis choices), and can handle transparency with differing levels of performance and visual accuracy.


Hey - aren't you the guy who created variance shadow mapping? I remember reading about it on Beyond3D.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sc4Freak
Hey - aren't you the guy who created variance shadow mapping? I remember reading about it on Beyond3D.

Along with William Donnelly (Pragma on these forums), yup. If you're interested in the technique feel free to ask question here, on Beyond3D or fire me an e-mail, or pick up GPU Gems 3 when it comes out :)

I'm also currently doing some interesting research related to VSMs, so hopefully that will pan out into improvements to the technique :)

Share this post


Link to post
Share on other sites
Okay, looking at deep shadow maps, it mostly makes sense. What I don't understand is, once lighting is being done, how a pixel knows its node index.

I was actually thinking about combining VSMs and DSMs. Would it be totally ridiculous to make a 3D VSM with z being the node index and rgb being depth, depth^2, and opacity respectively? And on top of that, doing 3 so it colors correctly? At that point, global illumination sounds simpler.

Share this post


Link to post
Share on other sites
Quote:
Original post by AndyTX
Quote:
Original post by Sc4Freak
Hey - aren't you the guy who created variance shadow mapping? I remember reading about it on Beyond3D.

Along with William Donnelly (Pragma on these forums), yup. If you're interested in the technique feel free to ask question here, on Beyond3D or fire me an e-mail, or pick up GPU Gems 3 when it comes out :)

I'm also currently doing some interesting research related to VSMs, so hopefully that will pan out into improvements to the technique :)

Look into caustics maps, this sounds like what he meant by the stained glass window earlier. Paper: graphics.cs.ucf.edu/caustics/caustics.pdf
It'd most likely have to be done on a per-pixel basis (you OGL weirdos and your mysterious 'fragments') to be of use in that scenario

These (caustics maps) guys also came up with interval maps, which I think are the niftiest little math hack I've seen in 3D graphics for quite some time. Working on integrating them with Policarpo's quadric method for accurate object silhouettes and then *finally* using the adjusted-Z method to generate us some VSMs! :D Overall it seems promising, if I decide to go further with it I'll probably add the fabled non-height-field surfaces gimmick. I think the shadows would even automatically adapt due to the Z-update thing, too.
And now that I think about it maybe I could even add the texture-based space skipping suggestion on top of it all. I shall call it... Super Ultra Hyper Mega Fun Uber Mapping!

EDIT: That per-channel idea actually sounds pretty interesting.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this