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!
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.
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.
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!
I currently use directional light - not a spotlight. Is the DX example shadowmap.fx compatible with directional lights - or spotlights only?
Thanks!
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.
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!
Anyone know a site that lists all the techniques, advantages / disadvantages of them?
Thanks!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement