Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

Static Shadowmap....

This topic is 4877 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

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...

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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...

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!