Page 1 of 1
Ground Fog
Posted: 12 Sep 2007, 07:01
by trepan
Notes:
- requires GL 2.0 (for the shaders)
- requires 24-bit depth buffer
(it uses the depth + camera pos + pixel direction to extract the world space coords)
Forboding Angel's EE-RiverGlade-v02 map:
P.S. I'll release it in LuaGaia form once I've cleaned it up some. I'm not really
sure that I'd ever want to play with it on though, doesn't really add all that much
for me.
P.P.S. The following parameters are easily changed:
- fog height
- fog attenuation
- fog color
There are plenty of variations on the current fog setup that could be coded.
Actually, there are a number of other interesting effects that can be done once
the pixel world coordinates are extracted. Here's a screenshot of my debug
mode for world space coords (3D grid @ 100 springthings):
http://trepan.bzflag.bz/spring/jpg/depthdebug.jpg
Posted: 12 Sep 2007, 09:09
by Warlord Zsinj
I hear sigourney weaver for a sequel; 'kroggies in the mist...'
I want to see this on aGorm's tree map :)
Posted: 13 Sep 2007, 04:07
by Felix the Cat
-Could a user (modder/mapper) change it to produce localized fog effects? Would be cool on certain maps, maybe fog over the water on a land/water map or fog in the woods or something. Would be cool with certain mods, having smoke accumulate when artillery fires or there's a big battle and lots of wreckage would be pure pwn.
-What's the framerate hit for this?
--If it's a lot (equivalent to large amounts of smoke), probably not very useful for a couple of years, until computers can generally handle it.
--If it isn't a lot, this might be an awesome replacement for some smoke effects with some changes to the code - obviously it wouldn't look as good as current smoke but it might be a settings option for people with lower-spec computers.
Posted: 13 Sep 2007, 04:25
by trepan
Nvidia 7900GS
water disabled
shadows enabled
ground fog enabled= 69 fps
ground fog disabled = 70 fps
test view:
http://trepan.bzflag.bz/spring/jpg/fogfps.jpg
Posted: 13 Sep 2007, 06:22
by Felix the Cat
Nice!
Posted: 16 Sep 2007, 03:59
by trepan
Haven't played with it much, but it's almost good enough.
Might throw in some fog variation:
http://trepan.bzflag.bz/spring/jpg/more-gnd-fog.jpg
Posted: 16 Sep 2007, 10:11
by Warlord Zsinj
It's very sexy.
I wonder if there's a way to have friendly units render above the fog - or render as outlines around the fog (many RTS's have something similar), so that you are still able to see and control your forces reasonably easily, though the enemy forces are still obscured.
Would also be helpful for those dense foliage maps like aGorm's tree map, as well as the planned urban maps that a few people are working on.
Posted: 16 Sep 2007, 10:23
by TechnoTone
I imagine the XRay Shader widget would do that.
Posted: 16 Sep 2007, 14:05
by Tim-the-maniac
Posted: 16 Sep 2007, 15:04
by trepan
Warlord Zsinj
Already covered, the test widget is setup so that it can render in
either the DrawWorld() pass or the DrawScreenEffects() pass
(at the beginning of the passes).
TechnoTone
Yup, xray shows through nicely, when using the DrawWord() pass.
Tim-the-maniac
Thanks, but I'm sure I could come up with a better screenshot that
had dynamic water and some units in it
Current fog flaws:
- translucent explosions are not rendered properly (could use explicit
fog coords to render them properly, but then the same goes for the
terrain and unit rendering as well, although it wouldn't be done per-
pixel as my shader trick does). Could also add a lua projectile shader.
- dualscreen mode does not work (at least not when the minimap
is on the left).
Posted: 19 Sep 2007, 16:10
by BoredJoe
Could you combine this with LOS so that the fog thickness gets thicker with distance?
Re:
Posted: 30 Mar 2008, 06:05
by MadRat
BoredJoe wrote:Could you combine this with LOS so that the fog thickness gets thicker with distance?
If you could integrate the fog effects as a wall for concealing unexplored territory then it would put a whole new meaning to "fog of war".