Thanks
fading fog into a skybox
-
3DModelerMan
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
fading fog into a skybox
Hi I was wondering if there is a way to make the fog fade into my skybox instead of a set color.
Thanks
.
Thanks
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
-
3DModelerMan
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
ummm
Like the way mountains fade into the atmosphere.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
since a skybox is always WAYYYYYYYYY far away........ then if fog were applied to the skybox the fog would always block the skybox because the skybox is so damn far away that it is past the end point of the fog. I know, it isnt really that far, but the way it is drawn it is supposed to be. Anyhow, mountains are 3d and you can calculate a fog value based upon the depth of it from the camera. The skybox is just a 2d image pasted across a polygon. No depth.
You could fake it by creating a 'foggy' looking skybox image.
You could fake it by creating a 'foggy' looking skybox image.
-
3DModelerMan
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
ummm
Well, what I mean is the alpha value of the fog.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
but the skybox is still so far away that the fog will definately have reached it's far limit, and since anything after the far limit is total fog..... the whole skybox will be nothing but fog. see what I mean? if you want to have a skybox affected by fog, I guess you could create 'walls' around your world and then put the skybox textures on them. Then if you applied fog to these 'walls' it would attempt to do it right, but the walls are just rectangles so either the whole thing is foggoed or not i think.....
-
3DModelerMan
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
no
I don't want the skybox to be affected by the fog, no matter how far the far value is, the skybox will still not be shown anyway. I mean how do I fade my terrain objects alpha channel with the fog, so the skybox shows through gradually.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
That's got nothing to do with the skybox then, you just want to fade out the objects based on their distance from the camera.
That's basically what the fog does but it overlays a fog colour on the node according to its distance from the camera.
So i guess you could change the node's material's diffuse colour (or one of the other colours) so that it's faded out and give the node a transparency material, vertex alpha i should think. I'm not sure if it will work though as i've always had trouble with changing diffuse colours on nodes...
That's basically what the fog does but it overlays a fog colour on the node according to its distance from the camera.
So i guess you could change the node's material's diffuse colour (or one of the other colours) so that it's faded out and give the node a transparency material, vertex alpha i should think. I'm not sure if it will work though as i've always had trouble with changing diffuse colours on nodes...
-
Frank Dodd
- Posts: 208
- Joined: Sun Apr 02, 2006 9:20 pm
I appreciate the effect your trying to create, although I don't think alpha would be the way do go with this making the terrain gradually transparent as the distance from the camera increases would create some very odd effects.
In the demonstration scenes I have created I simply balance the fog color against the average color of the skybox. Probably painting a heavily fogged band at the horizon of your skybox texture against which your fogged terrain would be silhouetted would help also.
In the demonstration scenes I have created I simply balance the fog color against the average color of the skybox. Probably painting a heavily fogged band at the horizon of your skybox texture against which your fogged terrain would be silhouetted would help also.
This is fine and dandy as long as you *have* a terrain.. The game I'm writing is based in space, and as such I'm having a very difficult time trying to get things in the distance fade out nicely without looking wacky. How do the commercial space shooter games do it?...Frank Dodd wrote:I simply balance the fog color against the average color of the skybox. Probably painting a heavily fogged band at the horizon of your skybox texture against which your fogged terrain would be silhouetted would help also.
-
3DModelerMan
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
ummm
Okay I'll base it on an average of the skybox color. I guess for the space shooter you could change the vertex alpha as they get farther from the camera?.
Thanks
.
Thanks
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar

