Fog implemented into the Skybox?
Fog implemented into the Skybox?
Hello, i've been working for around 2 weeks with the engine, but i have a question, if i have a terrain when it turns into fog from a distance just the terrain turn into fog (which is great because you have to implement fog to every element on the game) But how can i implemente the fog so it looks more real, example in a room you apply it to every wall or element in the room and it looks great (example quake 3 map)
But can i implement fog into the skybox so it gives the effect of fog into all the level?
thank you for your replies.
But can i implement fog into the skybox so it gives the effect of fog into all the level?
thank you for your replies.
You have to make some changes in engine and recompile it. In CSkyBoxSceneNode.cpp, CSkyBoxSceneNode::CSkyBoxSceneNode(...) you have to add for all materials line
This probably should be enough, but I dont't think it makes much sense since skybox is always sticked to the camera position.
Code: Select all
Material[?].FogEnable = true;
Thank you, what i want to get is the effect of fog all around the level.
I see your point, but imagine i'm creating this huge outdoor lever without any walls on it. just terrain, sea etc. How can i creat fog all around the level?
Maybe stick a model with 100% alpha, to the camera so far and so huge it will create de effect?
I see your point, but imagine i'm creating this huge outdoor lever without any walls on it. just terrain, sea etc. How can i creat fog all around the level?
Maybe stick a model with 100% alpha, to the camera so far and so huge it will create de effect?
If I understand you correctly, I see 2 possibilities depending of what you need.
1) if colour of fog is stable arround a game, it doesn't ever changes, all you need are correctly prepared textures for skybox, just make textures of sidewalls fading into fog colour from top to bottom. Here's example from my old test:
2) if you want colour of fog to be dynamic, it's little harder, you have to make textures as usual, but apply material type EMT_TRANSPARENT_VERTEX_ALPHA to side walls of skybox and make colour of bottom vertexes of the walls with alpha 0. Colour of background should be colour of fog. It should look ok, I think.
1) if colour of fog is stable arround a game, it doesn't ever changes, all you need are correctly prepared textures for skybox, just make textures of sidewalls fading into fog colour from top to bottom. Here's example from my old test:
2) if you want colour of fog to be dynamic, it's little harder, you have to make textures as usual, but apply material type EMT_TRANSPARENT_VERTEX_ALPHA to side walls of skybox and make colour of bottom vertexes of the walls with alpha 0. Colour of background should be colour of fog. It should look ok, I think.
Hmmm. I remember just setting a material flag on the map scenenode did the trick - then again, I'm two releases behind on Irrlicht, so it may no longer work that way.
Something like:
Something like:
Code: Select all
mapscenenode->setMaterialFlag( EMF_FOG_ENABLE , true);
Ive had this same problem..
Create a simple four wall structure with your modeling software and place it and size it a bit past half way up and span your entire viewing area.. add the fog to it and set it up..
Then just add a full transparent tga to it..
Latter on if you plan to make the level build as you move you could attach the object to follow the cam.. But like others said then your fog dosnt seem as real because its moving with you...
I plan to create simulators (Sims) sections of land and water that build as you walk near them in the distance ...
I plan to use the fog to my advantage to help mask this, I may have to use one of these four wall structures for each sim and just not add any colision to it so that character will walk past each one...
As its transparent they should blend together perfectly..
Just an idea..
Create a simple four wall structure with your modeling software and place it and size it a bit past half way up and span your entire viewing area.. add the fog to it and set it up..
Then just add a full transparent tga to it..
Latter on if you plan to make the level build as you move you could attach the object to follow the cam.. But like others said then your fog dosnt seem as real because its moving with you...
I plan to create simulators (Sims) sections of land and water that build as you walk near them in the distance ...
I plan to use the fog to my advantage to help mask this, I may have to use one of these four wall structures for each sim and just not add any colision to it so that character will walk past each one...
As its transparent they should blend together perfectly..
Just an idea..
fog on skybox, thoughts
I had the same problem but i wonder if I have the skybox shaded by fog then why even bother with this. THe skybox should be drawn as it was covered by the fog due we use static fog here (there is no wind which might change the density of the fog so some details can be revieled for awhile) so technically your view on the skybox won't ever change.
The transparent wall idea sounds perfect, but please let me know if you have any problem with walking around block houses (cityscape) so there will be intersection between the house far away and the transparent walls.
Also your transparent wall idea just gave me abother one: I don't like the skybox because it is impossible (very hard to get the clouds movin' so I'll have to abandon the skybox and use your idea because then I have perfect control over the fog and the sky above my virtual self image
thanks for the tip.
The transparent wall idea sounds perfect, but please let me know if you have any problem with walking around block houses (cityscape) so there will be intersection between the house far away and the transparent walls.
Also your transparent wall idea just gave me abother one: I don't like the skybox because it is impossible (very hard to get the clouds movin' so I'll have to abandon the skybox and use your idea because then I have perfect control over the fog and the sky above my virtual self image
thanks for the tip.