This topic is 3056 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites
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 on other sites
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 on other sites
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 on other sites
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?

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 13
• 9
• 12
• 9
• ### Forum Statistics

• Total Topics
631438
• Total Posts
3000073
×

## Important Information

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!