Jump to content

  • Log In with Google      Sign In   
  • Create Account


Change Effect Value while Shader is bounded


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 thmfrnk   Members   -  Reputation: 109

Like
0Likes
Like

Posted 26 March 2013 - 12:27 PM

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



Sponsor:

#2 belfegor   Crossbones+   -  Reputation: 2386

Like
0Likes
Like

Posted 26 March 2013 - 12:57 PM

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

 

for_each_mesh

    effect->SetValue(...)

    effect->SetValue(...)

    ...

    effec->CommitChanges();

    draw()



#3 thmfrnk   Members   -  Reputation: 109

Like
0Likes
Like

Posted 26 March 2013 - 01:43 PM

ahhh cool.. Thank you biggrin.png






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS