Page 1 of 1
Set the reflection texture ?
Posted: Fri May 02, 2008 12:30 pm
by arfgh
Hi, i want to ad some ENV effect to the models. But i need to know how to specify the texture to make the ENV. This is my code.
ITexture * texture = driver->getTexture(tex);
mesh = loader->getMesh(temp,texture);
obj=scene->addMeshSceneNode(mesh,node);
obj->setMaterialType(EMT_REFLECTION_2_LAYER);
the problem on this code is that EMT_REFLECTION_2_LAYER that cause a strange effect over the texture i used on the model.
How can i specify other texture to make the ENV effect ?
thanx
Posted: Fri May 02, 2008 11:31 pm
by hybrid
Ehh, getMesh(temp, texture)
What would that make? You have to set two textures via the material structure for reflection.
Posted: Fri May 02, 2008 11:46 pm
by arfgh
ITexture * texture = driver->getTexture(tex);
where tex = path to a texture
Posted: Sat May 03, 2008 1:52 pm
by arfgh
someone know how to do ?
Posted: Sat May 03, 2008 3:04 pm
by B@z
Code: Select all
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(meshpath));
node->setMaterialTexture(0, Game.driver->getTexture(text1));
node->setMaterialTexture(1, Game.driver->getTexture(text2));
node->setMaterialType(EMT_REFLECTION_2_LAYER);
you mean this?
Posted: Sat May 03, 2008 11:02 pm
by arfgh
but why is needed the addAnimatedMeshSceneNode ?
Posted: Sun May 04, 2008 5:17 pm
by arfgh
ok but the problem now is..
i want to add a ENV RGB color instead of the texture. Is possible ?
Posted: Tue May 06, 2008 9:16 am
by arfgh
somebody know if is possible to make that ?
Posted: Tue May 06, 2008 9:25 am
by hybrid
No, probably not possible, because the materials are not set up to use vertex colors. Use a small 1x1 pixel texture instead.
Posted: Tue May 06, 2008 10:14 pm
by arfgh
maybe exist some other procedure on the irrlitch to do that. Because i saw several pc games where the env in the cars is produced using RGB color.
Maybe someone know a way to do ?
Posted: Tue May 06, 2008 10:55 pm
by hybrid
What would that be good for? Anyway, you could write your own material renderer to do it.
Posted: Wed May 07, 2008 10:42 am
by arfgh
can you saw an example of that ?
Posted: Fri May 09, 2008 1:00 pm
by arfgh
somebody can figure to how to do that ?
that is to produce some env effect over the polygons with a RGB color value instead of a texture.