aboutsummaryrefslogtreecommitdiff
path: root/Gem/cubemaptosphere.frag
diff options
context:
space:
mode:
authorTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2016-11-28 12:49:04 +0000
committerTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2016-11-28 12:49:04 +0000
commit01015ee03992ae5a633f81aab434c905e1250c21 (patch)
tree9ee95b8a91ba520c10728f992c8d96e74020d424 /Gem/cubemaptosphere.frag
parent990ceb3a315d660d89b98e1d17c4e3f95182a1f3 (diff)
Gem 83e036efcfb97e8901669d4a49273f2f30283745 linux/amd64
built 'master:83e036efcfb97e8901669d4a49273f2f30283745' for linux/amd64
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;
+}