Game Development Community

T3D - 2 issues - Fog and transparency

by Scottie Sirius · in Torque 3D Professional · 10/13/2009 (4:30 pm) · 3 replies

I have 2 issues that I'm wondering about.
One is when the ground cover/grass is between the camera and the open air you can see an outline of the png. When it's between the camera and the scattersky it appears black. I wonder if its a bug, the way I have the ground cover set-up or just the way it is? You can see the outline all along the hill in Pic 1.

The second is whenever I get the fog looking the way I want it (pic 1) if I exit and come back into the Editor or the Game it turns bluish. (pic 2) Any cure to get it to stay the way I set it?


Pic 1

www.bloodclans.com/screenfoggrass1.jpg
Pic 2

www.bloodclans.com/screenfoggrass2.jpg

#1
10/13/2009 (5:52 pm)
I believe the GroundCover issue is caused by GroundCover not being written into the depth buffer (this is advanced lighting, right?) which is fixed for 1.1.
The other issue may be caused by the ScatterSky calculating the fog color (verify by changing the fog color to something specific, then changing the azimuth or elevation of the ScatterSky...if the fog color changes to the blueish you're seeing in pic 2, that's it). There should be a fogScalar value you can use to tweak the generated color, or if you're not planning on changing the time of day you could override the fog color via script after the mission loads.
#2
10/13/2009 (8:25 pm)
Yes, it's AL. Good to hear a fix is coming.
And yes, it appears to be the scattersky causing the problem with the colored fog. I don't see a fogScalar option but I think I got a close enough result messing with some of the other settings.

Thanks Ross!
#3
10/13/2009 (9:16 pm)
Glad that helped some :)

Ah, it appears there isn't a fogScale value. There are tweak scalars for the generated sun and ambient colors, but not the fog color. If you need more control you could easily set up a fogScale value on the ScatterSky by taking a look at mSunScale in scatterSky.cpp and doing the same stuff for the fog color. This would allow you to scale the whole color, or individual channels (so, if you wanted to turn that bluish color into a more gray color, you'd do something like 1 1 0.2 for the fogScale, which would minimize the influence of the blue channel on the generated fog color).