raze-gles/wadsrc/static/engine/shaders/glsl/polymost.vp

40 lines
836 B
Text
Raw Normal View History

#version 330
out vec4 v_color;
out float v_distance;
out vec4 v_texCoord;
out vec4 v_detailCoord;
out float v_fogCoord;
2020-01-03 17:34:43 +00:00
out vec4 v_eyeCoordPosition;
uniform float u_usePalette;
uniform mat4 u_rotMatrix;
uniform mat4 u_modelMatrix;
uniform mat4 u_projectionMatrix;
uniform mat4 u_detailMatrix;
2019-10-10 17:46:46 +00:00
uniform mat4 u_textureMatrix;
in vec4 i_vertPos;
in vec4 i_texCoord;
in vec4 i_color;
void main()
{
vec4 vertex = u_modelMatrix * i_vertPos;
vec4 eyeCoordPosition = u_rotMatrix * vertex;
2020-01-03 17:34:43 +00:00
v_eyeCoordPosition = eyeCoordPosition;
gl_Position = u_projectionMatrix * eyeCoordPosition;
eyeCoordPosition.xyz /= eyeCoordPosition.w;
2019-10-10 17:46:46 +00:00
v_texCoord = u_textureMatrix * i_texCoord;
v_detailCoord = u_detailMatrix * i_texCoord;
v_fogCoord = abs(eyeCoordPosition.z);
v_color = i_color;
v_distance = eyeCoordPosition.z;
}