Hi,
I would like to implement a fog (basically fog of war) over the terrain in the strategy game. My initial idea was to create few semitransparent planes with texture over each tile in the game, which works really well, however the performance drop is very significant (on my machine from 170FPS to 110FPS).
Do you have any ideas how to create a fog (or clouds) which would not be that resource consuming?
I am aware of Ogre fog functionality, however this is more for 3D shooters where player is in the fog. In this game you look down to the terrain and the fog should be displayed per tile visibility.
Thank you for any ideas and advices.
Fog over terrain
-
- Orc Shaman
- Posts: 737
- Joined: Fri May 31, 2013 2:28 am
- x 65
Re: Fog over terrain
its hard to say whats the problem without looking at codes and without detailed info on the technique and implementation spec( polygon count/tex resolution etc ) but it does sound too expensive for this kind of effect( no complex volumatric fog shaders right?... )
my guess is that you would be better off with expanding the terrain shader/material generator
anyway, first of all make sure that your'e not cpu bounded( in which case the cpu stalls the gpu )
if not, i suggest that you use some gpu performance/debug tool to see where the over-head comes from inside the gpu
if your'e debugger allergic like i am, you can always use the good old way of turning off features/lowering resource quality to check where the bottle-neck is
other than that there are dozens other of ways to achieve this kind of effect, just search the forums for "fog of war"( saw some posts with source-code )
i think there is a tendency today to do all the work on the gpu using shaders and lots of math, google key words are "efficient" "screen space" and "fog of war"
have fun
my guess is that you would be better off with expanding the terrain shader/material generator
anyway, first of all make sure that your'e not cpu bounded( in which case the cpu stalls the gpu )
if not, i suggest that you use some gpu performance/debug tool to see where the over-head comes from inside the gpu
if your'e debugger allergic like i am, you can always use the good old way of turning off features/lowering resource quality to check where the bottle-neck is
other than that there are dozens other of ways to achieve this kind of effect, just search the forums for "fog of war"( saw some posts with source-code )
i think there is a tendency today to do all the work on the gpu using shaders and lots of math, google key words are "efficient" "screen space" and "fog of war"
have fun
the woods are lovely dark and deep
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..
coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..
coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos
-
- Gnome
- Posts: 368
- Joined: Tue Jan 06, 2009 1:12 pm
- x 43
Re: Fog over terrain
Hi Frostbyte,
thank you for your answer. Basically I am playing around with the fog and trying to find out what can increase the FPS now.
It seems like overlapping of the meshes with transparent textures was the biggest problem there.
thank you for your answer. Basically I am playing around with the fog and trying to find out what can increase the FPS now.
It seems like overlapping of the meshes with transparent textures was the biggest problem there.