Page 1 of 1

OgreMax: duplicate material definitions

Posted: Thu Dec 22, 2011 12:57 pm
by JDX_John
I've noticed one model we are exporting is creating many copies of the same materials in the resulting .material file... I think multiple parts of the original (3DS) model use the same material but why would they export individually?

Initially all the copies were identical, but after we tweaked some things now we even get the same material with different definitions... here is a sample:

Code: Select all

material ski
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.952941 0.894118 0.737255 1
			specular 0.2 0.2 0.2 1 56.4386
		}
	}
}

material ext
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.8 0.8 0.8 1
			specular 0.2 0.2 0.2 1 56.4386

			texture_unit
			{
				texture heok1.jpg
			}
		}
	}
}

material ski
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.952941 0.894118 0.737255 1
			specular 0.2 0.2 0.2 1 56.4386
		}
	}
}

material ski
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.952941 0.894118 0.737255 1
			specular 0.2 0.2 0.2 1 56.4386
		}
	}
}

material art2
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.543333 0.0966667 0.16 1
			specular 0.08 0.08 0.08 1 61.4975
			scene_blend one_minus_src_colour dest_colour
		}
	}
}

material art2
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.543333 0.0966667 0.16 1
			specular 0.08 0.08 0.08 1 61.4975
		}
	}
}

material art2
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.543333 0.0966667 0.16 1
			specular 0.08 0.08 0.08 1 61.4975
			scene_blend one_minus_src_colour dest_colour
		}
	}
}

material art2
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.543333 0.0966667 0.16 1
			specular 0.08 0.08 0.08 1 61.4975
			scene_blend one_minus_src_colour dest_colour
		}
	}
}

material ski
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.952941 0.894118 0.737255 1
			specular 0.2 0.2 0.2 1 56.4386
		}
	}
}
As a non-artist I can't comment if this is a bug in OgreMax, a bug in the original models, or "just how things work", but it seems to me the same material should only be emitted once? Any advice on how to approach this is welcome.

Re: OgreMax: duplicate material definitions

Posted: Thu Mar 08, 2012 6:03 pm
by JDX_John
Had the same problem on another 3DS scene... bump! Anyone had this problem, anyone able to suggest what to do about it?

Re: OgreMax: duplicate material definitions

Posted: Fri Jan 16, 2015 10:08 pm
by Rykemapo
We had the same problem. It is in the original *.max file. Your artist made copies of materials instead of instances of materials.
Our artist took it one step further and renamed the copies. Now I have 15 times more materials and subentities than I should, which is killing my performance.