Bug in material inheritance with new script compilers?

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
x 2
Contact:

Bug in material inheritance with new script compilers?

Post by Noman »

From the ogre manual :
Using a unique name for a Texture unit in a pass of a cloned material adds a new texture unit at the end of the texture unit list for the pass.
My material script :

Code: Select all

// Reference material [geometry]
material DeferredShading/LightMaterial/Geometry
{
	technique DeferredTechnique
	{
		pass DeferredPass
		{
			// Don't disable depth test, because the light doesn't have to be rendered
			// if the bounding geometry is obscured.
			scene_blend add
			depth_write off
			depth_check on
			lighting off
			
			texture_unit GBuffer1
			{
				tex_address_mode clamp
				filtering none
			}
			texture_unit GBuffer2
			{
				tex_address_mode clamp
				filtering none
			}
		}
	}
}

// Reference material [geometry w/shadows]
material DeferredShading/LightMaterial/GeometryShadow : DeferredShading/LightMaterial/Geometry
{
	technique DeferredTechnique
	{
		pass DeferredPass
		{
			texture_unit ShadowMap
			{
				content_type shadow
			}
		}
	}
}
However, the resulting material DeferredShading/LightMaterial/GeometryShadow has only two texture units, the first of them being the ShadowMap texture unit. So, even though I have unique texture names, the first texture unit gets overwritten by the added texture unit.

Am I missing something or is this a bug with the script compilers?

User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3
Contact:

Re: Bug in material inheritance with new script compilers?

Post by Praetor »

I'll have to test this.
Game Development, Engine Development, Porting
http://www.darkwindmedia.com

User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
x 2
Contact:

Re: Bug in material inheritance with new script compilers?

Post by Noman »

This problem may have been solved directly / indirectly after the branch that started the GSoC projects this year. After the merge back into head (not comitted yet, don't worry!) the problem has gone away and the demo functions correctly again.

Post Reply