• Advertisement
Sign in to follow this  

help in stencil shadowing

This topic is 4847 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! I'm developping a fatasy strategy game, and I would like to generate shadows of the units on the terrain. I read the papers about stencil shadow volumes, and I don't understand a few things: - If I have 50 unit with 1000-1500 vertices per unit, is the stencil shadowing the best solution? - What if I'm using fragment/vertex shaders (lightning, miltitextring, etc.) with VBOs? Will the stencil work? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
I'd suggest that stencil shadowing is -not- the way to go in this situation, purely because of the amount of geometry involved. You could probably produce a very satisfactory effect simply with "blurry blob" shadows on the ground under each unit.

That said, stencil shadowing should work ok with most rendering systems. The classic method is to render everything with ambient light, then render everything with lighting minus those areas stencilled out by shadow, using additive blending on top of the ambient pass.

However, you will need to know the final rendered vertex positions of all the geometry that is casting shadows, because silhouette determination needs to be done on the CPU. (Technically, it's possible to assume every edge may be casting a shadow and let the GPU take all the load, but in general this will be slower.) So you may have to be careful with your use of vertex programs, ie avoid manipulating the vertex position. Multitexture and fragment shaders aren't going to be a problem.

Share this post


Link to post
Share on other sites
stencil shadows work better inside for positional lights, for outdoors youre better of with shadowmaps or doing what posit saiz a shadow under each character (ala quake3, and many other programs)

Share this post


Link to post
Share on other sites
OK, thanks.

Can I create a more realistic shadow with blurry blob than created in serious sam?



Share this post


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

  • Advertisement