From 7b41b52db1e8914d75677dd79e32d0510827163c Mon Sep 17 00:00:00 2001 From: XProger Date: Sat, 2 Feb 2019 02:37:16 +0300 Subject: [PATCH] add sky shader --- src/shaders/sky.glsl | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/shaders/sky.glsl diff --git a/src/shaders/sky.glsl b/src/shaders/sky.glsl new file mode 100644 index 0000000..3de28d4 --- /dev/null +++ b/src/shaders/sky.glsl @@ -0,0 +1,30 @@ +R"====( +#ifdef GL_ES + precision lowp int; + precision highp float; +#endif + +varying vec4 vColor; +varying vec2 vTexCoord; + +#ifdef VERTEX + uniform mat4 uViewProj; + + attribute vec4 aCoord; + attribute vec4 aColor; + attribute vec4 aTexCoord; + + void main() { + vColor = aColor; + vTexCoord = aTexCoord.xy; + gl_Position = uViewProj * vec4(aCoord.xyz * 5.0, 1.0); + gl_Position.z = gl_Position.w; + } +#else + uniform sampler2D sDiffuse; + + void main() { + gl_FragColor = texture2D(sDiffuse, vTexCoord) * vColor; + } +#endif +)====" \ No newline at end of file