fast shadows? projected or stencil or something else?

Started by
6 comments, last by zedzeek 18 years, 8 months ago
Hello! I would like to render shadow to my models. I read this tutorial about projected shadows: http://frustum.org/3d/index.php?demo=7 Using FrameBuffer Object could be an easy way. It is efficient for approx. 50 models too? Or is there any faster shadow rendering method? I'm using fbo to render water and it is fast. Better then switching opengl context. Can I render shadows with fbo? I hope, i explained my problem clearly. So, i'm looking for a fast and efficient method to render animated models ( a lot of models). Thanks...
Advertisement
What you want is called shadow mapping. There are some good papers on shadow mapping at NVidia's developer site.
And, yes, you can use framebuffer objects. It is in fact one of the reasons for their invention.
More information on EXT_frambuffer_object.
Quote:
It is efficient for approx. 50 models too?


Shadow mapping technique scales very well with increased scene complexity. With shadow mapping, the number of rendering passes required is 1 per light perspective. 1 for a spotlight, but 6 for a point light (projects shadows in every direction). So a scene with many models probably won't be as slow as a scene with 10 models, but more then a few shadow-projecting lights.
The problem is that ideally most lights you want in a first or third person environment to be point lights making normal shadow mapping severely lacking. If you restrict your viewpoint however to some sort of locked overhead view, this might be feasible.

Cubic shadow buffers are not feasible for games right now but in a few years with more powerful hardware they may become viable.

I think right now shadow volumes are the best current solution, however they have the very annoying requirement that your models be closed 2-manifold surfaces which for amateurs is a big deal since you can't just pop in a random model and expect it to work.
Quote:I think right now shadow volumes are the best current solution, however they have the very annoying requirement that your models be closed 2-manifold surfaces which for amateurs is a big deal since you can't just pop in a random model and expect it to work.


So true... having that same struggle with my current project.
Oh, thanks guys. Actually, i write an turn based fantasy strategy game. So, I have only a sun that creates shadow for my models.

I checked the nvidia site for fbo usage for shadow mapping, and i don't fully understand why the demo doesn't attach depth render buffer to the fbo. Has anybody used fbo to shadow mapping? Can help me a little bit?
[Edit: Ignore what I first posted]

Maybe this thread can help.


[Edited by - James Trotter on August 8, 2005 10:59:18 AM]
whilst u can use FBO to help with shadowmaps its not exactly faster (only ~%10) what it does buy you though is the shadowmap size is not tied to the screensize
check out example number 7 in the FBO spec

This topic is closed to new replies.

Advertisement