first commit
This commit is contained in:
16
shader/drand48.frag
Normal file
16
shader/drand48.frag
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 450 core
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
/* returns a varying number between 0 and 1 */
|
||||
float drand48(vec2 co)
|
||||
{
|
||||
return 2 * fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453) - 1;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
float gray=drand48(gl_FragCoord.xy);
|
||||
|
||||
FragColor=vec4(vec3(gray),1.0);
|
||||
}
|
Reference in New Issue
Block a user