Does IShaderConstantSetCallback() get called for each camera?
Does IShaderConstantSetCallback() get called for each camera?
If I have multiple camera's rendering the scene from the different views, does the callback for that shader get called for each camera?
Re: Does IShaderConstantSetCallback() get called for each camera?
It means you render the scene several times, so yes - everything is called for each camera.
IShaderConstantSetCallBack::OnSetMaterial is called every time the video driver had another active material and switches to the shader material to which the callback belongs.
IShaderConstantSetCallBack::OnSetConstants is called on every draw call in the driver - so every time you send any graphic primitives to the GPU and the shader material to which the callback belongs is active.
And relatively new in trunk is a IShaderConstantSetCallBack::OnCreate function which is only called once after adding the shader material.
IShaderConstantSetCallBack::OnSetMaterial is called every time the video driver had another active material and switches to the shader material to which the callback belongs.
IShaderConstantSetCallBack::OnSetConstants is called on every draw call in the driver - so every time you send any graphic primitives to the GPU and the shader material to which the callback belongs is active.
And relatively new in trunk is a IShaderConstantSetCallBack::OnCreate function which is only called once after adding the shader material.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Does IShaderConstantSetCallback() get called for each camera?
Thanks for the info. I came across some cool shaders in this repo: https://github.com/netpipe/IrrlichtDemos
I was wanting to integrate some of them into RCBasic but when I was looking through the shader constants in some of them, it was using the active camera position for the light source and the active camera can change constantly before the render step. I just wanted to make sure it was able to call it for each camera.
I was wanting to integrate some of them into RCBasic but when I was looking through the shader constants in some of them, it was using the active camera position for the light source and the active camera can change constantly before the render step. I just wanted to make sure it was able to call it for each camera.