Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17063

glsl u_time

$
0
0

Hi, why is the color not animated:

#ifdef GL_ES

precision mediump float;

#endif

 

uniform vec2 u_resolution;

uniform float u_time;

 

vec3 colorA = vec3(0.912,0.411,0.288);

vec3 colorB = vec3(1.000,0.833,0.224);

 

void main() {

   vec3 color = vec3(0.0);

 

   float pct = abs(sin(u_time));

 

   // Mix uses pct (a value from 0-1) to

   // mix the two colors

   color = mix(colorA, colorB, pct);

 

   gl_FragColor = vec4(color,1.0);

}

 

Many thanks

 


Viewing all articles
Browse latest Browse all 17063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>