move shaders into .glsl files and add #include feature
This commit is contained in:
10
data/shaders/include/rand.glsl
Normal file
10
data/shaders/include/rand.glsl
Normal file
@@ -0,0 +1,10 @@
|
||||
// http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/
|
||||
highp float rand(mediump vec2 co)
|
||||
{
|
||||
highp float a = 12.9898;
|
||||
highp float b = 78.233;
|
||||
highp float c = 43758.5453;
|
||||
highp float dt= dot(co.xy, vec2(a,b));
|
||||
highp float sn= mod(dt, 3.14);
|
||||
return fract(sin(sn) * c);
|
||||
}
|
||||
Reference in New Issue
Block a user