summaryrefslogtreecommitdiff
path: root/data/shaders/skybox-frag.glsl
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-09-21 20:31:17 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-09-21 20:34:43 -0400
commita700f36d804e9c6c64bdb4aa00bd7a039f3f553e (patch)
treec890b3348a8c07e718300685edfc6f562ca0c17e /data/shaders/skybox-frag.glsl
parenta4f403625aa06197f9cd724da9f50dda47c216cc (diff)
Add missing skybox shader files.
Oopsies!
Diffstat (limited to 'data/shaders/skybox-frag.glsl')
-rw-r--r--data/shaders/skybox-frag.glsl28
1 files changed, 28 insertions, 0 deletions
diff --git a/data/shaders/skybox-frag.glsl b/data/shaders/skybox-frag.glsl
new file mode 100644
index 0000000..b388828
--- /dev/null
+++ b/data/shaders/skybox-frag.glsl
@@ -0,0 +1,28 @@
+// -*- mode: c -*-
+
+#ifdef GLSL120
+varying vec3 fragDir;
+#else
+in vec3 fragDir;
+#endif
+
+#ifdef GLSL330
+out vec4 fragColor;
+#endif
+
+#ifndef GLSL330
+#define fragColor gl_FragColor
+#endif
+
+uniform samplerCube cubeMap;
+
+#ifndef GLSL330
+// Compatibility shim for older GLSL versions.
+vec3 texture(samplerCube tex, vec3 coord) {
+ return textureCube(tex, coord);
+}
+#endif
+
+void main() {
+ fragColor = texture(cubeMap, fragDir);
+}