# Directional Lights, Orthographic projections, and shadow maps

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

## Recommended Posts

##### Share on other sites
The 5.0 means that the orthograpic projection should be 5 world space units wide, and the other 5.0 means 5.0 world space units tall.

It really just depends how big of an object you are trying to fit in the limited space of the shadow map. In this case you could fit a sphere of radius 2.5 units.

The other magic # matrix is most likely set up to

1) reverse the Y axis texcoords
2) convert -1..1 range into 0..1
3) apply a depth bias

##### Share on other sites
ldeej,
can you tell me where can find a implementation of directional light of shadow map?
thanks.

##### Share on other sites
Nothing comes to mind. Which part are you stuck on?

I actually took out the orthogonal projection for directional lights out of my engine to simplify the code. Since I am doing a separate shadow map for each shadow caster, I can treat a directional light as a distant point light.

##### Share on other sites
Quote:
 Original post by SimmerDNothing comes to mind. Which part are you stuck on?I actually took out the orthogonal projection for directional lights out of my engine to simplify the code. Since I am doing a separate shadow map for each shadow caster, I can treat a directional light as a distant point light.

Humm...why not still make the seperate shadow maps orthogonal though? Just to kind of unify the shadowing system?

##### Share on other sites
Yes, just a way to simplify and unify things. With a far enough point ( I use 500 meters or so ), you get the same result with a small frustum.

##### Share on other sites
I got the directional shadow map samples from both the NVidia and the ATI sites:

The Nvidia sample if for prespective shadow mapping, but it also has modes for directional lights with plain shadow maps.

##### Share on other sites
ldeej
Thanks，i find it.

1. 1
Rutin
39
2. 2
3. 3
4. 4
5. 5

• 14
• 18
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633360
• Total Posts
3011517
• ### Who's Online (See full list)

There are no registered users currently online

×