Jump to content
  • Advertisement
Sign in to follow this  

OmniDirectional Shadow Mapping

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all,


I've done simple directioal light shadow mapping, but now I'd like to try my hand in point light shadow mapping.


I've decided to shoot for cubic shadow mapping, so I've already setup up a cubic renderTargetView/DepthBuffer/ShaderResourceView and rendered my scene from the view point of the light in the x,x-,y,y-,z,z- directions.


Now I guess I've come to a bit of a standstill on how to best approach this in a shader perspective.

My Initial thought was to send six LightViewMatrices and check against each of them in my pixel shader for the shadow map textureCube.


But that's a lot of overhead! And a lot of data to send down the bus per frame.

Is there a better way to approach this? Especially since I'm using a point light and textureCube construct in my shader.


Any response is appreciated!


Marcus Hansen

Share this post

Link to post
Share on other sites
6 matrices per frame is not much -- 384 bytes per light per frame frame. 100 lights at 60Hz might add up to 2MB/s, over a bus rated in GB/s :)

For comparison, an animated character might have 100 bone matrices supplied per frame.

But... Why do you need 6 matrices? The cube itself has one rotation and one translation value, which should be identical for every face, right?

Also, seeing as it's omnidirectional, you you even need to support rotation at all? A simple translation / light position value should be enough.

[edit] i.e. Subtracting the light position surface position gives you the direction from the light to the surface, which is the texture coordinate to use when sampling from the cube-map.

Share this post

Link to post
Share on other sites

Your right I was approaching it in a pretty convoluted fashion :p. 

Anyhow I got it working using a single matrice for the point light. Now I just have deal with some peter-panning of the shadows


P.s. I don't know why but it makes me cringe to have to send more data to the shader then just a few matrices and a variable or two.

      I would imagine however doing PCF in the pixel shader to be a bit more intensive

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!