If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
-
arfgh
- Posts: 104
- Joined: Sat Aug 26, 2006 6:15 am
Post
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
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
-
Contact:
Post
by hybrid »
Ehh, getMesh(temp, texture)
What would that make? You have to set two textures via the material structure for reflection.
-
arfgh
- Posts: 104
- Joined: Sat Aug 26, 2006 6:15 am
Post
by arfgh »
ITexture * texture = driver->getTexture(tex);
where tex = path to a texture
-
arfgh
- Posts: 104
- Joined: Sat Aug 26, 2006 6:15 am
Post
by arfgh »
someone know how to do ?
-
B@z
- Posts: 876
- Joined: Thu Jan 31, 2008 5:05 pm
- Location: Hungary
Post
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?
-
arfgh
- Posts: 104
- Joined: Sat Aug 26, 2006 6:15 am
Post
by arfgh »
but why is needed the addAnimatedMeshSceneNode ?
-
arfgh
- Posts: 104
- Joined: Sat Aug 26, 2006 6:15 am
Post
by arfgh »
ok but the problem now is..
i want to add a ENV RGB color instead of the texture. Is possible ?
-
arfgh
- Posts: 104
- Joined: Sat Aug 26, 2006 6:15 am
Post
by arfgh »
somebody know if is possible to make that ?
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
-
Contact:
Post
by hybrid »
No, probably not possible, because the materials are not set up to use vertex colors. Use a small 1x1 pixel texture instead.
-
arfgh
- Posts: 104
- Joined: Sat Aug 26, 2006 6:15 am
Post
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 ?
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
-
Contact:
Post
by hybrid »
What would that be good for? Anyway, you could write your own material renderer to do it.
-
arfgh
- Posts: 104
- Joined: Sat Aug 26, 2006 6:15 am
Post
by arfgh »
can you saw an example of that ?
-
arfgh
- Posts: 104
- Joined: Sat Aug 26, 2006 6:15 am
Post
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.