To implement shader,we need to implement
"IShaderConstantSetCallBack" class.
In this class ,the method looks like below,
virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
{..}
how can I supply "s32 userData" parameter from outside?
Is this the only way,and the right way to supply constants to shader from outside?
for example;
given that there are several scene nodes,and I want to supply different constants to each shader of each scene node.How can I achieve this?
I think there is a way we can supply the "s32 userData" parameter of above method of "IShaderConstantSetCallBack" class above?
Am i right? so we implement it inside the above method to supply different constants.
how can I supply parameter to shader?
You can also implement OnSetMaterial and use
MaterialTypeParam
MaterialTypeParam2
for individual nodes, like so
http://irrlicht.sourceforge.net/docu/cl ... _back.html
userdata is set in
addHighLevelShaderMaterialFromFiles
(last parameter)
MaterialTypeParam
MaterialTypeParam2
for individual nodes, like so
http://irrlicht.sourceforge.net/docu/cl ... _back.html
userdata is set in
addHighLevelShaderMaterialFromFiles
(last parameter)
Never take advice from someone who likes to give advice, so take my advice and don't take it.