scop/src/shader.fs

23 lines
622 B
GLSL

#version 330
uniform float time;
uniform sampler2D ourTexture;
out vec4 FragColor;
flat in int vID;
float rand(float n)
{
return fract(sin(n) * 43758.5453123);
}
void main()
{
vec3 color = vec3(rand(float(vID + int(time))), rand(float(vID + int(time))), rand(float(vID + int(time))));
FragColor = vec4(color, 1.);
//FragColor = vec4(color * 0.001 + texture(ourTexture, gl_FragCoord.xy / vec2(480., 360.)).rgb, 1.0);
//FragColor = vec4(color * 0.1 + texture(ourTexture, gl_FragCoord.xy).rgb, 1.0);
//FragColor = vec4(color * 0.01 + texture2D(ourTexture, gl_FragCoord.xy / vec2(480., 360.)).rgb, 1.0);
}