Jump to content
  • Advertisement
Sign in to follow this  
wasd

Lighting in RTS style games

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

Just wondering how everyone handles lighting in RTS style games. At the moment, I'm writing a game which will be played on a heightmap level, and I've been thinking of different ways to do the lighting. Currently, I have: Load fixed lighting information with the level (e.g. Number of lights, light types & colours etc) and just use these when everything or Load fixed lighting information with the level, but only use that when drawing the terrain or Load a lightmap for the terrain and have seperate lighting information for things on the terrain I just wanted to know what approach other people used when lighting an RTS so that they can have localised lights (for gun fire, explosions etc) and general lighting for the world. Any tips or anything.

Share this post


Link to post
Share on other sites
Advertisement
I would just have local lighting and one light for amibience overall. Then if certain parts of the levels should be lit, keep a database of where so you can turn them on when you are close by.

Share this post


Link to post
Share on other sites
I am the 3D R&D guy on Atari's ActofWar, and, although I can not go into detail, here's some insight:
Partial lighting precomputation is used for the terrain. Models use per vertex or per pixel SH PRT lighting.
Dynamic lighting with extra render passes can be added or removed, depending on HW. I tried using far lights as a contribution to sh lighting, but the effect of this are quite minor, because you rarely have very large vright light that are not the sun.
The sun (and far away direction lights) is treated separately from the sh lighting, with dynamic shadowing, specular, etc...
And ambient sky plus backlights is used to tune the fixed SH contribution of the sky.

The main problem with having precomputed lighting on a level, is that it produces large maps that are not suitable for making small downloadable levels.

I hope this helps.

Share this post


Link to post
Share on other sites
We have just one light, the sun + shadowmap.
Combined with fullscreen glow, it it just enough for outdoor RTS.
I tried AO for terrain, when sunlight is not very intense, it gives really good results for showing the shape of terrain, but SH PRT would be an better option here, because it can give smooth shadows for direct sunlight in addition to AO.
Adding bumpmaps to terrain can add to visuals too, especially on slopes (where angle between the sunlight and the surface can vary a lot).

Share this post


Link to post
Share on other sites
Quote:
Original post by janos
The main problem with having precomputed lighting on a level, is that it produces large maps that are not suitable for making small downloadable levels.
I hope this helps.


You use SH only for local lighting?
And are you using it for the terrain also?

Share this post


Link to post
Share on other sites
I have tried SH lighting for the terrain, but just for fun. It is not practical since the terrain can definitely not be considered as a point like object with a far away lighting environment ( aprerequise for PRT lighint, at least in the form we are talking about), because of all the objects on it.

Share this post


Link to post
Share on other sites
Quote:
Original post by janos
I have tried SH lighting for the terrain, but just for fun. It is not practical since the terrain can definitely not be considered as a point like object with a far away lighting environment ( aprerequise for PRT lighint, at least in the form we are talking about), because of all the objects on it.


That's correct too, but imho it is better to have SH (and AO) for terrain and have it shade correctly the terrain with no objects, and slightly incorect with objects (but object contribution should be made via shadowmap anyway), so generally imho it is a good thing.
Imagina a rainy weather, where almost no directional lighting exists - the shape of terrain will be flat, without directional light, if no SH/AO lighting.

Share this post


Link to post
Share on other sites
I would just bake the lighting directly onto the terrain texture. I think some FPS games might even use that method (UT2004? Something like that?) Ooh, I was going to post some code, but it's copyrighted. Check with Frank Luna's website for some resources and stuff. Good luck!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!