ISceneNode's and Materials

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.
Post Reply
kevinsbro
Posts: 51
Joined: Fri Nov 05, 2010 8:18 pm

ISceneNode's and Materials

Post by kevinsbro »

So I'm pretty sure I already know the answer, but when I try and change the material of an empty scene node it stays at its defaults. The basic empty Scene Node isn't meant to care about materials is it?
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: ISceneNode's and Materials

Post by REDDemon »

if the scene node gets rendered and has "driver->setMaterial()" called from inside the "render" method the material is setted up correctly.
Everything drawn after "setMaterial" will have that material.. unless you are calling "setMaterial" again in some other scene node. In that case the material will be overwrited with the new material.

Usually a parent node is drawn before children, but you are not supposed to make assumpions on order of drawing (unless you manually draw nodes in a certain order). The material used is the one wich has been setted with the last "setMaterial()" call.

The empty scene node is usually used to group other scene nodes. To transform its children. To attach to it some particle emitter or a camera. to organize better the scene. It has many usages. You can also use it to set a Material if you know that all its children will not change material and they are drawn after the "setMaterial" call. Keep in mind that there are also multiple renderpasses (1 pass for solid materials, 1 for alpha and 1 special).
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Post Reply