Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Author: Jeremy Rotsztain
- // Course: ShaderArt (DIGF-3011, Winter 2022)
- // Title: RGB Gradients
- // Edited by: Amanda Huynh Feb 9 2022
- #ifdef GL_ES
- precision mediump float;
- #endif
- uniform vec2 u_resolution;
- uniform vec2 u_mouse;
- uniform float u_time;
- void main() {
- // normalize our canvas
- vec2 st = gl_FragCoord.xy/u_resolution.xy;
- // normalize our mouse position
- vec2 mouseXY = u_mouse / u_resolution;
- // set color #1 manually (peach)
- vec3 red = vec3(1.664,0.009,0.280);
- // pick color #2 manually (blue)
- vec3 blue = vec3(0.037,0.081,2.128);
- // change the 'space' where the gradient changes
- // using GLSL "shaping functions"
- vec3 color = mix( red, blue, smoothstep( 0.032,0.5*2.224, st.x));
- gl_FragColor = vec4(color,1.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement