ho3/resources/shaders/water.vertex

26 lines
519 B
Plaintext
Raw Normal View History

2024-06-08 20:24:26 +00:00
attribute vec3 vPosition;
attribute vec2 vTexCoord;
uniform mat4 ProjectionMatrix;
uniform mat3 ModelRotateMatrix;
uniform vec3 ModelTranslateVector;
2024-06-06 13:25:38 +00:00
uniform vec3 CamPos;
2024-06-08 20:24:26 +00:00
varying vec2 texCoord;
varying vec3 vertexPos;
2024-06-06 13:25:38 +00:00
varying vec3 camVec;
void main()
{
2024-06-08 20:24:26 +00:00
vec4 realVertexPos = vec4(ModelRotateMatrix * vPosition.xyz + ModelTranslateVector, 1.0);
gl_Position = ProjectionMatrix * realVertexPos;
texCoord = vTexCoord;
camVec = -(vPosition.xyz - CamPos);
2024-06-06 13:25:38 +00:00
2024-06-08 20:24:26 +00:00
//camVec = vec3(0, 1, 0);
2024-06-06 13:25:38 +00:00
2024-06-08 20:24:26 +00:00
//camVec.y = -camVec.y;
2024-06-06 13:25:38 +00:00
}