Materials and depth buffer

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
manowar
Orc
Posts: 419
Joined: Thu Apr 07, 2005 2:11 pm
Location: UK
Contact:

Materials and depth buffer

Post by manowar »

Hello

I have a simple material used to render an objet always on the top of the scene. I Thought that adding depth_check false would do the trick.

Code: Select all

material Mat/Green 
{
	technique
	{
		pass
		{
			depth_check false
			
			texture_unit
			{

				colour_op_ex source1 src_manual src_current 0 1 0
			}			
			
		}
	}
}
However the 'depth_check test' does not work for some reason. To have the expected results I have to call setDepthCheckEnabled(false); in a frame listener. Also calling setDepthCheckEnabled(false); in CreateScene() does not work too. Could you please tell me why the setting in the script do not work ?
Thanks a lot

Eric
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Because anything that's rendered after it, and in front of it, will still obscure it. If you want something to always be on top you have to do 2 things - turn of depth check AND make sure it gets rendered last. Assign it to a later render queue to do this.
Post Reply