Change Effect Value while Shader is bounded

Started by
1 comment, last by B-Real 11 years ago

Hey,

I'm wondered that it is not possible to change a Shader Value (SetValue) of an Effect which was already bound.. In OpenGL it is possible to update any Uniform Variable even the shader still enabled. I think in some reasons this could cause a lot of CPU load. In my example I have a Scene graph including some meshes and each mesh haves a couble of subs with different materials. So I need to load (begin) and disable the shader for each sub, because of changing material and matrix... Same for my lighting pipeline.

I'm right or doing something wrong ?

Cheers,

Thomas

Advertisement

Call "effect->CommitChanges()" after you change shader constant.

for_each_mesh

effect->SetValue(...)

effect->SetValue(...)

...

effec->CommitChanges();

draw()

ahhh cool.. Thank you biggrin.png

This topic is closed to new replies.

Advertisement