aboutsummaryrefslogtreecommitdiffstats
path: root/Assets/Common/Shaders/vert/RefTransCubeMapReflection_DistDark_Qt.vert
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Common/Shaders/vert/RefTransCubeMapReflection_DistDark_Qt.vert')
-rw-r--r--Assets/Common/Shaders/vert/RefTransCubeMapReflection_DistDark_Qt.vert30
1 files changed, 30 insertions, 0 deletions
diff --git a/Assets/Common/Shaders/vert/RefTransCubeMapReflection_DistDark_Qt.vert b/Assets/Common/Shaders/vert/RefTransCubeMapReflection_DistDark_Qt.vert
new file mode 100644
index 0000000..7278f9b
--- /dev/null
+++ b/Assets/Common/Shaders/vert/RefTransCubeMapReflection_DistDark_Qt.vert
@@ -0,0 +1,30 @@
+#ifndef GL_ES
+
+#define lowp
+#define mediump
+#define highp
+#define precision
+
+#endif
+
+uniform highp mat4 mvp;
+uniform highp mat4 modelMatrix;
+uniform highp mat3 modelNormalMatrix;
+uniform highp vec3 eyePosition;
+
+attribute highp vec4 vertexPosition;
+attribute highp vec3 vertexNormal;
+
+varying highp vec3 v_CubeTexCoord;
+varying highp float v_Distance;
+
+void main()
+{
+ gl_Position = mvp * vertexPosition;
+
+ v_Distance = gl_Position.z / gl_Position.w;
+
+ highp vec3 view = eyePosition - (modelMatrix * vertexPosition).xyz;
+ highp vec3 normalWorld = normalize(modelNormalMatrix * vertexNormal);
+ v_CubeTexCoord = reflect(view, normalWorld);
+}