Static Shadowmap....

Started by
13 comments, last by _the_phantom_ 19 years, 2 months ago
I have decided to just use a static shadowmap to self shadow my terrain. I was wondering does anyone have any idea if you could do the shadowmap creation in a VP/FP or would that be to slow? Also I have read the article on gamedev.net about fast computation of terrain shadowmaps, and the code is not to well commented for a tutorial. So I was wondering does anyone else have any decent code or tutorials on the same topic or maybe a better way to generate the shadowmap? I would like to hear what peoples thoughts are on the VP/FP idea...
Advertisement
You sound a bit confused.
* Shadowmapping is when you render from the lights point-of-view to a depth texture, then when you render the scene you compare the depths-texture to the scene to see what's in shadow and what's not.
Having a static shadow-map works as long as nothing moves inside the shadow..

Using VP/FP to create a Shadowmap.. i see no point (it's easier and.. same speed to do it with fixed functions) if you'r not using TSM or something fancy that is.


The terrain shadow things discussed here have usually been a shadow texture you use on the terrain just like the normal texture (nothing like shadowmapping). Just like in Quake3.. :)
The creation of this should be done in MAX/Maya or you own specific program made just for this, not in your game.

I would go with normal shadowmapping. Dynamic shadows are always nice. But it totally depend on what you want, your target hardware etc.

Good luck!
Quote:Original post by gulgi
You sound a bit confused.
* Shadowmapping is when you render from the lights point-of-view to a depth texture, then when you render the scene you compare the depths-texture to the scene to see what's in shadow and what's not.
Having a static shadow-map works as long as nothing moves inside the shadow..

Using VP/FP to create a Shadowmap.. i see no point (it's easier and.. same speed to do it with fixed functions) if you'r not using TSM or something fancy that is.


The terrain shadow things discussed here have usually been a shadow texture you use on the terrain just like the normal texture (nothing like shadowmapping). Just like in Quake3.. :)
The creation of this should be done in MAX/Maya or you own specific program made just for this, not in your game.

I would go with normal shadowmapping. Dynamic shadows are always nice. But it totally depend on what you want, your target hardware etc.

Good luck!


So if I go with a standard shadowmapping sceme with FFP and make a depth texture can I use this texture to stretch over my whole terrain? Will this self shadow or just shadow objects that are in the way of the terrain... I am looking for self shadowing as of right now and am planning on doing the shadowmapping for my units.
shadow mapping will self shadow.. sometimes it can cause artifacts though.
You might be ok using static lightmaps for your terrain, maybe just have it a resolution of 2 * width, 2 * height (or better yet break it up a bit) that would give you a little better than per vertex lighting values and cost you very little. To do a shadowmap for terrain is expensive, as it is a whole extra render, and you would also most likely need an insanely huge shadow map to get even remotely good aliasing. As for shadow mapping for your units, thats viable, but i say you should either use fixed function per vertex lighting for your terrain, or use a static lightmap (im debating whether splitting it up is a good idea or not)

hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
I already have per pixel lighting working in a VP/FP. I am now trying to decide on which way to do shadowing.
Shadowmapping means at least one more render-pass (at some point.. you don't have to update every frame), depending on how many shadow-maps you use.
And as have been said, if you use one shadowmap for the whole terrain, the quality can be really bad. This can somewhat be helped with more complicated shadow-mapping-algorithms as PSM, TSM and LispSM.
I would use one shadow-map per object/character.. terrain is usually quite flat and doesn't cast that much shadow...

To use a shadow-map with VP/FP is very straight-forward. Read the extension texts. I posted GLSL code for shadow-mapping a while back as well..

Good luck!
Sure he doesnt hafta update the shadow maps every frame, but why wouldnt he want to? Except for the case of maybe, calcing the shadow map every 3 frames or something like that, the ADVANTAGE of shadowmaps is that theyre dynamic, lightmaps would be precompouted, static(advantage or disadvantage, you tell me), and another advantage over shadow maps, have the same resolution over the whole terrain.

hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Quote:Original post by gulgi
Shadowmapping means at least one more render-pass (at some point.. you don't have to update every frame), depending on how many shadow-maps you use.
And as have been said, if you use one shadowmap for the whole terrain, the quality can be really bad. This can somewhat be helped with more complicated shadow-mapping-algorithms as PSM, TSM and LispSM.
I would use one shadow-map per object/character.. terrain is usually quite flat and doesn't cast that much shadow...

To use a shadow-map with VP/FP is very straight-forward. Read the extension texts. I posted GLSL code for shadow-mapping a while back as well..

Good luck!


So you are saying I can calculate the shadowmap inside my VP/FP without using FFP methods?
Quote:Original post by Ademan555
Sure he doesnt hafta update the shadow maps every frame, but why wouldnt he want to? Except for the case of maybe, calcing the shadow map every 3 frames or something like that, the ADVANTAGE of shadowmaps is that theyre dynamic, lightmaps would be precompouted, static(advantage or disadvantage, you tell me), and another advantage over shadow maps, have the same resolution over the whole terrain.

hope that helps
-Dan


Not sure which way you are leaning, but I have for the most part decided against having a dynamic light. I tried it and the scene gets to dark for nightime to be fun in a game and to be real that is real... I am thinking the best looking static lightmap precalculated for shadows and per pixel lighting would be good enough for most gamers...

This topic is closed to new replies.

Advertisement