Rodrix
12-15-2006, 05:15 AM
Hi guys!
Here I am posting some picture of my projects as I promised so long ago!
I hope you like them :)
I got the trees and animated leaves with my particle system (winter picture shows some leaves flowing in the wind), and now trying to add shadows...
Performance is a very big issue for me so I want to implement a solution with the lowest FPS impact, and I was considering a solution similar to shadow maps (but without generating them on runtime everytime). Please tell me what do you think about this:
For each 'scenario' bake a shadowmap and save it in a 1024x1024 image file. Then load the image as a blended texture on the terrain using multitexturing. I just need plants to produce static shadows using also the texture data of the plants (the trees are made by polys and contain transparent texture rendered with alpha test, so I would need leaves depicted in the texture also produce static shadows).
If you consider this a good idea (I am looking for something easy to implement too) I would greatly appreciate if you tell me how to do the following:
Could anyone post the code on how to do this:
-project each plant to the terrain in black color to reproduce shadow given a light direction and save to disk into an image that contains all plants 'shadows' (I suspect it has something to do with stencil buffer but I am totally lost on how to do it, nor on how to save a texture to disk).
I have read a lot of papers on Shadow Mapping, dynamic shadow mapping, and all seem really difficult as they talk about solutions using plain opengl, others using extensions, and others using shaders ('hardware shadow mapping'). I read about the two passes that are needed rendering the scene from the light source and then from camera view, the problems about the texture definition, the advantages and disadvantages vs volume shadows, blah, blah. Then I found like thousands of different approaches like Adaptive Shadow Maps (ASM) vs Light Space Perspective (LiSPSM), or Perspective Shadow Maps (PSM), or 'Adaptive Shadow Maps'... 'Variance Shadow Maps'... sorry but I am completly lost and I can't find one plain and SIMPLE example! :confused:
So I would greatly appreciate if you could help me with the code above! Thanks!
Thanks so much in advance!
Cheers!
Rod
http://pianonews.googlepages.com/vb62006-12-1511-48-30-60.jpg
http://pianonews.googlepages.com/vb62006-12-1511-46-11-85.jpg
http://pianonews.googlepages.com/vb62006-12-1511-47-24-71.jpg
Here I am posting some picture of my projects as I promised so long ago!
I hope you like them :)
I got the trees and animated leaves with my particle system (winter picture shows some leaves flowing in the wind), and now trying to add shadows...
Performance is a very big issue for me so I want to implement a solution with the lowest FPS impact, and I was considering a solution similar to shadow maps (but without generating them on runtime everytime). Please tell me what do you think about this:
For each 'scenario' bake a shadowmap and save it in a 1024x1024 image file. Then load the image as a blended texture on the terrain using multitexturing. I just need plants to produce static shadows using also the texture data of the plants (the trees are made by polys and contain transparent texture rendered with alpha test, so I would need leaves depicted in the texture also produce static shadows).
If you consider this a good idea (I am looking for something easy to implement too) I would greatly appreciate if you tell me how to do the following:
Could anyone post the code on how to do this:
-project each plant to the terrain in black color to reproduce shadow given a light direction and save to disk into an image that contains all plants 'shadows' (I suspect it has something to do with stencil buffer but I am totally lost on how to do it, nor on how to save a texture to disk).
I have read a lot of papers on Shadow Mapping, dynamic shadow mapping, and all seem really difficult as they talk about solutions using plain opengl, others using extensions, and others using shaders ('hardware shadow mapping'). I read about the two passes that are needed rendering the scene from the light source and then from camera view, the problems about the texture definition, the advantages and disadvantages vs volume shadows, blah, blah. Then I found like thousands of different approaches like Adaptive Shadow Maps (ASM) vs Light Space Perspective (LiSPSM), or Perspective Shadow Maps (PSM), or 'Adaptive Shadow Maps'... 'Variance Shadow Maps'... sorry but I am completly lost and I can't find one plain and SIMPLE example! :confused:
So I would greatly appreciate if you could help me with the code above! Thanks!
Thanks so much in advance!
Cheers!
Rod
http://pianonews.googlepages.com/vb62006-12-1511-48-30-60.jpg
http://pianonews.googlepages.com/vb62006-12-1511-46-11-85.jpg
http://pianonews.googlepages.com/vb62006-12-1511-47-24-71.jpg