Y Irrlicht does't have CallBack(setting uniforms) for nodes?
Posted: Sat Dec 06, 2014 12:42 pm
Would't it be efficient if irrlicht has ShaderCallBacks for Nodes rather than for MaterialRenderers ?
Consider this case: Nodes [A1,A2.....An] want to use single shader and different callback classes (for setting the node properties/uniforms). For loading the shader in irrlicht we need to pass the callback class object as an argument.
The problem is
1) In Irrlicht we can not use a common callback class for all the Nodes[A1...An], because each nodes have different values for properties/uniforms to pass to shaders.
2) Even if we use a common callback class for all Nodes, we cannot identify for which node the onSetMaterial(..)/OnSetConstant(..) has been called ?
Because of this issue i've loaded same shaders for multiple times Shaders[S1,S2...Sn] for Nodes[A1,....An] with callback Instance[C1....Cn]. But loading many shaders consumes more memory. To avoid loading same shader for multiple times, My suggestion is to have callbacks for nodes rather than for shaders.
Is there any other way in irrlicht for this case ? Please share if.Sorry if i'm unaware about new methods.
Thank you
Consider this case: Nodes [A1,A2.....An] want to use single shader and different callback classes (for setting the node properties/uniforms). For loading the shader in irrlicht we need to pass the callback class object as an argument.
The problem is
1) In Irrlicht we can not use a common callback class for all the Nodes[A1...An], because each nodes have different values for properties/uniforms to pass to shaders.
2) Even if we use a common callback class for all Nodes, we cannot identify for which node the onSetMaterial(..)/OnSetConstant(..) has been called ?
Because of this issue i've loaded same shaders for multiple times Shaders[S1,S2...Sn] for Nodes[A1,....An] with callback Instance[C1....Cn]. But loading many shaders consumes more memory. To avoid loading same shader for multiple times, My suggestion is to have callbacks for nodes rather than for shaders.
Is there any other way in irrlicht for this case ? Please share if.Sorry if i'm unaware about new methods.
Thank you