Underwater fog
by Rev. A. Bell · in Torque Game Engine · 08/28/2001 (6:15 pm) · 5 replies
Hello out there,
I hope this hasn't been asked already, but has anyone figured out how to change the colour of the underwater fog? Seems like this should be a fairly simple task, but I can't find it anywhere.
Thanks,
Barry
I hope this hasn't been asked already, but has anyone figured out how to change the colour of the underwater fog? Seems like this should be a fairly simple task, but I can't find it anywhere.
Thanks,
Barry
About the author
#2
08/28/2001 (7:39 pm)
Hmmm...so currently you can only set the one fog colour. I guess this means a trip to the C++ code ;)
#3
I've played around a little with the render code in waterBlock.cc and fluidRender.cc. In waterBlock.cc I hardcoded the first 3 values in mFluid.SetFogParameters(), on line 435, to 1.0, 0.0, 0.0 to give pure red. In fluidRender.cc I ensured that m_ShowFog was TRUE. However, this only seems to affect the surface of the water (not the underwater environment), though it was one funky effect :)
I'm not at home right now, so I can't try this out yet, but I think my next attempt will be to simply modify the sceneState fog colour when the camera is submerged and call setupFog() again. Any comments on this approach? My one great fear is that there will be a halfway point where the surface fog is seen underwater, or vice-versa.
08/29/2001 (9:08 am)
There's one thing I've been wondering about regarding the underwater fog, it seems to me that the fog appears closer when you are submerged. That would lead me to believe that there is in fact different fog behavior when you are under the water. I've played around a little with the render code in waterBlock.cc and fluidRender.cc. In waterBlock.cc I hardcoded the first 3 values in mFluid.SetFogParameters(), on line 435, to 1.0, 0.0, 0.0 to give pure red. In fluidRender.cc I ensured that m_ShowFog was TRUE. However, this only seems to affect the surface of the water (not the underwater environment), though it was one funky effect :)
I'm not at home right now, so I can't try this out yet, but I think my next attempt will be to simply modify the sceneState fog colour when the camera is submerged and call setupFog() again. Any comments on this approach? My one great fear is that there will be a halfway point where the surface fog is seen underwater, or vice-versa.
#4
glColor4f(.2, .6, .6, .3);
This is where the water color is defined.
08/29/2001 (11:19 am)
game.cc line 969glColor4f(.2, .6, .6, .3);
This is where the water color is defined.
#5
Barry
08/29/2001 (1:09 pm)
Thanks so much! That's exactly what I was looking for. Never thought to look at game.cc, makes sense though. Can't wait to try it when I get home :)Barry
Torque Owner David R. Green
David