Setting shader constants per-scene node

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
JTippetts
Posts: 7
Joined: Wed Oct 19, 2011 12:44 am

Setting shader constants per-scene node

Post by JTippetts »

Hi, sorry to trouble everyone again.

I'm trying to figure out the best way of setting shader constants on a per-scene-node basis, rather than just per material. I searched and found http://irrlicht.sourceforge.net/forum/v ... el#p251239 but that topic seemed to dribble off without the question being answered. Is there currently a way to specify shader constants/uniforms that should be set on a per-model basis? Or some other callback somewhere when a node is rendered that will let me specify shader constants?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Setting shader constants per-scene node

Post by hendu »

Not possible, as far as I know.

The workarounds are one material per node, or drawing the needed nodes separately instead of by the scene manager.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Setting shader constants per-scene node

Post by Mel »

It can be done using a Lighting Manager. The lighting manager performs routines on a per node basis, so if you need something executed prior to a rendering, you can do it using a Lighting Manager. Then, in the shader constants set callbacks, you can react to anything done in the lighting manager.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
JTippetts
Posts: 7
Joined: Wed Oct 19, 2011 12:44 am

Re: Setting shader constants per-scene node

Post by JTippetts »

Yeah, it looks like I can make the LightManager work, with a little bit of work. I guess I just sort of automatically passed over the LightManager interface in my search, since what I'm trying to do isn't necessarily lighting-related. Thank you.
Post Reply