aboutsummaryrefslogtreecommitdiff
path: root/Gem/cubemaptosphere.frag
diff options
context:
space:
mode:
authorTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2016-12-21 21:52:25 +0000
committerTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2016-12-21 21:52:25 +0000
commit027150827a4b2f641415225afb3b5a2ec8732617 (patch)
tree5b95ed443bcbba685ec4a9de608e1a380eba64f8 /Gem/cubemaptosphere.frag
parenta4b06f660a60ad1e1002b3300c8f6b8e54dfcba6 (diff)
Gem 0002aa3425e54b0c993fc9a5009ee7798aa3ba01 osx/x86_64
built 'master:0002aa3425e54b0c993fc9a5009ee7798aa3ba01' for osx/x86_64
Diffstat (limited to 'Gem/cubemaptosphere.frag')
-rw-r--r--Gem/cubemaptosphere.frag17
1 files changed, 17 insertions, 0 deletions
diff --git a/Gem/cubemaptosphere.frag b/Gem/cubemaptosphere.frag
new file mode 100644
index 0000000..cd2befb
--- /dev/null
+++ b/Gem/cubemaptosphere.frag
@@ -0,0 +1,17 @@
+// Antoine Rousseau september 2015
+#version 120
+
+uniform samplerCube envMap;
+uniform float alpha = 1.0;
+
+void main() {
+
+ vec2 tc = gl_TexCoord[0].st ;
+ vec2 thetaphi = ((tc * 2.0) - vec2(1.0)) * vec2(3.1415926535897932384626433832795, 1.5707963267948966192313216916398);
+ float ctpy = cos(thetaphi.y);
+
+ vec3 rayDirection = vec3(ctpy * cos(thetaphi.x), sin(thetaphi.y), ctpy * sin(thetaphi.x));
+
+ gl_FragColor = textureCube(envMap, rayDirection);
+ gl_FragColor.a *= alpha;
+}