From 9ffa4681d3817a22c2438ea638b071980cc6fb89 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Wed, 26 Feb 2014 21:53:29 +0100 Subject: [PATCH] Better when actually include the shaders. --- data/shaders/sky.frag | 17 +++++++++++++++++ data/shaders/sky.vert | 0 2 files changed, 17 insertions(+) create mode 100644 data/shaders/sky.frag create mode 100644 data/shaders/sky.vert diff --git a/data/shaders/sky.frag b/data/shaders/sky.frag new file mode 100644 index 000000000..60bacbfe0 --- /dev/null +++ b/data/shaders/sky.frag @@ -0,0 +1,17 @@ +#version 330 +uniform samplerCube tex; +uniform mat4 InvProjView; +uniform vec2 screen; + +in vec2 uv; +out vec4 FragColor; + +void main(void) +{ + vec3 eyedir = gl_FragCoord.xyz / vec3(screen, 1.); + eyedir = 2.0 * eyedir - 1.0; + vec4 tmp = (InvProjView * vec4(eyedir, 1.)); + eyedir = tmp.xyz / tmp.w; + vec4 color = texture(tex, eyedir); + FragColor = vec4(color.xyz, 1.); +} diff --git a/data/shaders/sky.vert b/data/shaders/sky.vert new file mode 100644 index 000000000..e69de29bb