Fog effect with orthographic camera


06-01-2011 10:33:14


I use orthographic camera and want to use fog effect in Mogre.

For example:
mSceneMgr.SetFog(FogMode.FOG_LINEAR, fadeColour, 0, 50, 500);
mSceneMgr.SetFog(FogMode.FOG_EXP2, fadeColour, 0.003f);

But I have one problem with orthographic camera. While the fog effect works fine in with perspective camera, it doesnt work with orthografic camera.

In addition to that, I dont use any terrain in my program. Instead of terrain, I use Rectangle2D then i do some settings ;

Rectangle2D rect = new Rectangle2D(true);
rect.SetCorners(-1.0f, 1.0f, 1.0f, -1.0f);
// Render the background before everything else
rect.RenderQueueGroup = (byte)RenderQueueGroupID.RENDER_QUEUE_BACKGROUND;
// Use infinite AAB to always stay visible
AxisAlignedBox aab = new AxisAlignedBox();
rect.BoundingBox = aab;
rect.VisibilityFlags = 2;
SceneNode nodeBack = Mogre.Root.Singleton.GetSceneManager("Main").RootSceneNode.CreateChildSceneNode("BackgroundNode");

My Rectangle2D isnt effected by fog , it is correct because it doesnt has any perspective properties.

I have two question;

1- Can i use fog effect in orthographic camera?

2- Can i use fog effect with infinite Rectangle2D background ?



07-01-2011 22:11:07

In my application I use the orthographic camera for a viewport which shows the top view.
The application uses the terrain scene manager, meshes and a horizontal plane as water surface.

For you I made some modifications to test it.
The result: No fog is visible.
Even when the camera distance is big enough (in relation to the fog distance settings).

So it seems that fog is disabled for orthographic cameras.
I don't know if it can be enabled somehow.

This is a good question for the main forum, because it's a common Ogre question.
In the main forum are much more users and you have a better chance to get an answer for that.

Now I found your redundant post in the main forum.
If (hopefully) somebody will answer, then please tell us the solution.


10-01-2011 08:08:22

Thanks your advice , I have already posted as you said but ogre forum said :)

You are in the wrong forum, here(Mogre forum) is the one you should ask your question on


10-01-2011 11:22:37

What a bad boy. He want to kick you out from the main forum.
Now I was playing your mommy and fight for your right :wink: