Sign in to follow this  
famous

Shadow-Map approximation with Parallax-Mapping

Recommended Posts

famous    101
Hi there, imagine 3 directional lights on the surface of a huge sphere surrounding a scene forming an equiliteral triangle. We calculate shadow maps for every one of those 3 lights. Now there's another directional light in the middle of the triangle for which we wanna approximate a shadow map with (occlusion) parallax mapping by taking the shadow maps of the surrounding 3 lights into account. Can anyone explain me somewhat exactly how this works? I don't really get it. Parallax-Mapping simulates depth with the help of a texture + heightmap but a shadow map only produces a heightmap, right? Even if we had a texture where would it be located? In order to calculate parallax we would have to trace a ray through the texture but if the whole scene has a size of thousands of units where would the scene texture be located?

Share this post


Link to post
Share on other sites
Hodgman    51328
Maybe you could draw a picture?
You talk about directional lights having positions instead of directions... Is the fact that the triangle is equilateral relevant? Why is one light's shadow map being derived from 3 other shadow maps? If the triangle has a texture, the texture is located on the triangle, right? Why does the size of the triangle in "units" change anything? I don't get it.

Share this post


Link to post
Share on other sites
famous    101
Quote:
Original post by HodgmanYou talk about directional lights having positions instead of directions...


I built a huge sphere surrounding the scene with many directional lights to simulate ambient light while still being able to incorporate self occlusions.

Quote:
Is the fact that the triangle is equilateral relevant?


No, just made this constraint to keep it as easy and understandable as possible.

Quote:
Why is one light's shadow map being derived from 3 other shadow maps?


This was also determined by me. You could probably go with 2 or more than 3 but you'll probably get the best results in terms of cost/performance ratio with 3.

Quote:
If the triangle has a texture, the texture is located on the triangle, right? Why does the size of the triangle in "units" change anything? I don't get it.


Hopefully my answer to your first question did clarify this. The surrounding sphere is not a rigid object. It just defines how the directional lights are arranged to simulate ambient light as good as possible.
Now in order to compute shadows for a scene you'd have to calculate shadow maps for every single directional light which is pretty expensive. But because you know that the lights are pretty close together it might be a good idea to approximate some shadow maps by using the shadow maps of some adjancent lights.
This should apparently work with parallax mapping but I'm not sure how.

Share this post


Link to post
Share on other sites
famous    101
Ok lets simplify this:

Parallax-Mapping is able to generate a new view from a texture + corresponding height map. Now lets say I generate a shadow map of a scene from viewpoint A and want to approximate a shadow map for viewpoint B whose relative position/orientation to A is known. How does that work?

The problem is that I don't have a texture anymore but solely a shadow map. Additionally, to generate parallax I have to raytrace the texture but since the shadow map doesn't lie on a solid object it doesn't have a location in space and therefore can't be raytraced.

Does this make any sense now?

Share this post


Link to post
Share on other sites
famous    101
Lets even simplify this more ;)

We create a shadow map from the view of one directional light (parallel-projection!). Now we have another directional light whose distance and orientation relative to the first directional light are known.
How can we approximate a view for the 2nd light from the first one?

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