Jump to content
  • Advertisement
Sign in to follow this  
fordfanboi

Shadows

This topic is 3201 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

I'm totally new to shadowing. I've been looking through the Shadow Map examples and noticed I need to render everything multiple times - which will kill the FPS in my app. I'm looking for two approaches. First would be the easiest method to use ( requires the least amout of code intrusion ). This way I can get a grasp on shadowing and see it in my app. Second would be a method that has the highest bang for the buck in CPU / GPU cycles, sacrificing shadow quality considering that I plan to cast shadows from all trees / buildings onto the terrain below, and onto one another. Is there an approach where I don't have to render all the meshes multiple times? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Rendering everything twice shouldn't be very expensive. When rendering to the shadow-map you only need to write the depth, so you don't have to use any expensive pixel shaders for it.

Shadow-mapping is probably the easiest way too.. though you could look at stencil-shadows and see if you like it better.

If your lights and objects are static, you can pre-calculate the shadows into lightmaps. For dynamic shadows shadow-mapping is probably the fastest.

Share this post


Link to post
Share on other sites
Thanks for the info!

I currently use directional light - not a spotlight. Is the DX example shadowmap.fx compatible with directional lights - or spotlights only?

Thanks!

Share this post


Link to post
Share on other sites
Shadow mapping seems to be the direction everything is going. You can use an orthographic projection for directional lights. For a large scene coverage, you will have to use some level of detail method like cascading shadow maps. As mentioned, rendering the scene into the shadow maps isn't too bad because the pixel shader is trivial; and on dx10 you can use a depth buffer.

Share this post


Link to post
Share on other sites
I ran into some issues using the sample shadowmap.fx shader and code. The biggest problem is texture alpha. Apparently that shader doesn't look at alpha since the shadows from the pine trees are rectangular instead of triangular like the texture. Any way around this?

Anyone know a site that lists all the techniques, advantages / disadvantages of them?

Thanks!

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!