OgreMax: duplicate material definitions

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
JDX_John
Gnome
Posts: 397
Joined: Sat Nov 08, 2008 1:59 pm
x 2

OgreMax: duplicate material definitions

Post 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.
JDX_John
Gnome
Posts: 397
Joined: Sat Nov 08, 2008 1:59 pm
x 2

Re: OgreMax: duplicate material definitions

Post 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?
Rykemapo
Gnoblar
Posts: 6
Joined: Wed Apr 30, 2014 2:35 pm
x 2

Re: OgreMax: duplicate material definitions

Post 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.
Post Reply