opengl - Change color component -


i'm writing graphic shader program. wrote need except color changing. in cycle there passing counter variable shader , have change it's color white orange shade. have change achive this?

i'm not sure i've got right, guess need this:

uniform float counter; // assumed range 0 .. 1  const vec3 white = vec3(1,1,1); const vec3 orange = vec3(1,0.6,0.2);  void main() {      vec3 mixedcolor = mix(white,orange,counter);     // white counter < 0,     //         orange counter > 1,     //         shaded in between } 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -