summaryrefslogtreecommitdiff
path: root/shaders/humus-hdr/4.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/humus-hdr/4.shader_test')
-rw-r--r--shaders/humus-hdr/4.shader_test64
1 files changed, 64 insertions, 0 deletions
diff --git a/shaders/humus-hdr/4.shader_test b/shaders/humus-hdr/4.shader_test
new file mode 100644
index 0000000..5edbfac
--- /dev/null
+++ b/shaders/humus-hdr/4.shader_test
@@ -0,0 +1,64 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+#version 130
+#define saturate(x) clamp(x,0.0,1.0)
+#define lerp mix
+
+varying vec3 cubeCoord;
+
+
+#line 14
+uniform samplerCube RGB;
+uniform samplerCube Exp;
+
+uniform vec2 scaleBias;
+
+void main(){
+ vec3 sky = textureCube(RGB, cubeCoord).rgb;
+ float ex = textureCube(Exp, cubeCoord).x;
+
+ // Expand RGBE
+ sky *= exp2(ex * scaleBias.x + scaleBias.y);
+
+ gl_FragColor.rgb = sky.rgb;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[vertex shader]
+#version 130
+#define saturate(x) clamp(x,0.0,1.0)
+#define lerp mix
+
+varying vec3 cubeCoord;
+
+
+#line 6
+void main(){
+ gl_Position = gl_Vertex;
+ cubeCoord = gl_MultiTexCoord0.xyz;
+}
+
+
+