diff options
author | 2021-05-21 22:50:39 +0900 | |
---|---|---|
committer | 2021-05-21 22:50:39 +0900 | |
commit | 32264925b9cc54b8b8b92fa40e0717095a1bb9d7 (patch) | |
tree | 640baf7342f30e5cfb6f39a5952a06a172bc75cd /Assets/Common/Shaders/vert/RefTransCubeMapReflection_DistDark_Qt.vert | |
parent | 5c0cca5b770cb30d547f3d7c56be9f46aa1a31b8 (diff) |
initial commit
Diffstat (limited to 'Assets/Common/Shaders/vert/RefTransCubeMapReflection_DistDark_Qt.vert')
-rw-r--r-- | Assets/Common/Shaders/vert/RefTransCubeMapReflection_DistDark_Qt.vert | 30 |
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);
+}
|