Changing all materials in the scene.
-
3DModelerMan
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Changing all materials in the scene.
Is there an automatic way to change all the materials in the scene to a specific type, then change them all back? Or do I have to use the brute force method, and search the scene graph?
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
You have to brute force it, but you can get an array of scene nodes from getSceneNodesFromType. Then you'll just need another array of the same size to store all the material types until you change them back.
What are you doing this for? A normal or depth map?
What are you doing this for? A normal or depth map?
What about the OverrideMaterial?
http://irrlicht.sourceforge.net/docu/cl ... 7277abf14a
http://irrlicht.sourceforge.net/docu/cl ... 7277abf14a
this.DtD wrote:What about the OverrideMaterial?
http://irrlicht.sourceforge.net/docu/cl ... 7277abf14a
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
3DModelerMan
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Does the override material get switched back after I've changed it though? What if I just looped through all the nodes, then stored the're materials in memory, and switched to the material I wanted, then when I was done, switched back to the ones I stored in memory? Would that take up too much memory?
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
-
3DModelerMan
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Oh okay, is there a good way to seperate the logic of my nodes, from the rendering? I'm going to be calling smgr->drawAll() multiple times for multipass rendering, so I don't want the animators to execute every single draw call. Maybe disable and then reenable them all?
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar