Metal effect?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Christoph

Metal effect?

Post by Christoph »

Hello!

I would like to know how i can reflect the environment of a rectangle for example. So that it looks like metal. I think there is such an effect in Irrlicht (SphereMap) but i don't know how to use it. Can somebody please help me?!


Thanks for advance!
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

Post by disanti »

Look at the techdemo. It uses that effect on one of the faries. :wink:
________
Mexicocity Hotel
Last edited by disanti on Tue Feb 22, 2011 8:04 am, edited 1 time in total.
Honkey Kong
Posts: 16
Joined: Mon Jan 12, 2004 4:31 am
Location: USA
Contact:

Post by Honkey Kong »

It's probably a little bit late now, but if you're still curious on how to do this, here's some sample code:

Code: Select all

IAnimatedMesh* mesh = smgr->getMesh("modelFile");
IAnimatedMeshSceneNode* anode = 0;

anode = smgr->addAnimatedMeshSceneNode(mesh);
anode->setPosition(vector3df(0, 0, 0));

anode->setMaterialTexture(0, driver->getTexture("modelTexture0"));
anode->setMaterialTexture(1, driver->getTexture("modelTexture1"));

anode->setMaterialType(EMT_REFLECTION_2_LAYER);
	
anode->addShadowVolumeSceneNode();
smgr->setShadowColor(SColor(50,0,0,0));
Just replace "modelFile" with the filename of the mesh you're loading, then replace "modelTexture0" and "modelTexture1" with your two texture maps, and your mesh should have a normal skin, and a reflection map. Hope this helps you out!
Image
Post Reply