mirror of
https://github.com/bvanroll/shaders.git
synced 2025-08-29 12:02:44 +00:00
aspect ratio
This commit is contained in:
21
learning/shapes/main.frag
Normal file
21
learning/shapes/main.frag
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
uniform vec2 u_resolution;
|
||||
uniform vec2 u_mouse;
|
||||
uniform float u_time;
|
||||
|
||||
varying vec2 v_texcoord;
|
||||
|
||||
void main(void) {
|
||||
vec4 color = vec4(vec3(0.0), 1.0);
|
||||
vec2 pixel = 1.0/u_resolution.xy;
|
||||
vec2 st = gl_FragCoord.xy * pixel;
|
||||
vec2 uv = v_texcoord;
|
||||
|
||||
color.rgb = vec3(st.x,st.y,abs(sin(u_time)));
|
||||
|
||||
gl_FragColor = color;
|
||||
}
|
Reference in New Issue
Block a user