the material code from tutorials doesn't work !

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
pw
Gnoblar
Posts: 9
Joined: Fri Sep 23, 2005 3:54 am

the material code from tutorials doesn't work !

Post by pw »

Code: Select all

material Template/try_to_blend
{
	technique
	{
		pass
		{
			texture_unit
			{
				texture Grass.png	
			}
			texture_unit
			{
				texture alpha_blend.png
				colour_op alpha_blend
			}
			texture_unit
			{
				texture Destina.png
				colour_op_ex blend_current_alpha src_texture src_current
			}
		}
	}
}
i made it to be my ground plane with the code

Code: Select all

	Plane plane(Vector3::UNIT_Y,0);
	MeshManager::getSingleton().createPlane("IDNamaPlane",
		ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,plane,1500,1500,
		20,20,true,1,5,5,Vector3::UNIT_Z);
	Entity* ent = mSceneMgr->createEntity("GroundPlane","IDNamaPlane");
	mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
	ent->setMaterialName("Template/try_to_blend");
the only picture shown in the plane is the last picture which is Destina.png.why it doesn't look like how it should on artist & content creation tutorials page ?
someone please help me :(
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

Replace the second texture unit with the following:

Code: Select all

texture_unit
{
    texture alpha_blend.png
    colour_op_ex source1 src_current src_current
    alpha_op_ex source1 src_texture src_texure
}
In the third unit you probably want to swap the src_texture and src_current. Else the alpha controls the base texture not the second splatted texture.

I can only recommend to read manual section 3.1 as it explains these operations and what they do. Where did you find this material?
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
discipline
OGRE Community Helper
OGRE Community Helper
Posts: 766
Joined: Mon May 16, 2005 12:09 am

Post by discipline »

Post Reply