2019-10-06 08:46:23 +00:00
|
|
|
#version 330
|
2019-07-12 08:44:36 +00:00
|
|
|
|
2019-10-06 08:46:23 +00:00
|
|
|
out vec4 v_color;
|
|
|
|
out float v_distance;
|
|
|
|
out vec4 v_texCoord;
|
|
|
|
out vec4 v_detailCoord;
|
|
|
|
out float v_fogCoord;
|
2019-07-12 08:44:36 +00:00
|
|
|
|
|
|
|
uniform float u_usePalette;
|
|
|
|
uniform mat4 u_rotMatrix;
|
2019-10-06 08:19:51 +00:00
|
|
|
uniform mat4 u_modelMatrix;
|
|
|
|
uniform mat4 u_projectionMatrix;
|
|
|
|
uniform mat4 u_detailMatrix;
|
2019-10-10 17:46:46 +00:00
|
|
|
uniform mat4 u_textureMatrix;
|
2019-07-12 08:44:36 +00:00
|
|
|
|
2019-10-06 08:46:23 +00:00
|
|
|
in vec4 i_vertPos;
|
|
|
|
in vec4 i_texCoord;
|
|
|
|
in vec4 i_color;
|
|
|
|
|
|
|
|
|
2019-07-12 08:44:36 +00:00
|
|
|
const float c_zero = 0.0;
|
|
|
|
const float c_one = 1.0;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2019-10-06 08:46:23 +00:00
|
|
|
vec4 vertex = u_rotMatrix * i_vertPos;
|
2019-10-06 08:19:51 +00:00
|
|
|
vec4 eyeCoordPosition = u_modelMatrix * vertex;
|
|
|
|
gl_Position = u_projectionMatrix * eyeCoordPosition;
|
2019-07-12 08:44:36 +00:00
|
|
|
|
|
|
|
eyeCoordPosition.xyz /= eyeCoordPosition.w;
|
|
|
|
|
2019-10-10 17:46:46 +00:00
|
|
|
v_texCoord = u_textureMatrix * i_texCoord;
|
2019-10-06 08:46:23 +00:00
|
|
|
v_detailCoord = u_detailMatrix * i_texCoord;
|
2019-07-12 08:44:36 +00:00
|
|
|
|
2019-10-06 08:29:17 +00:00
|
|
|
v_fogCoord = abs(eyeCoordPosition.z);
|
2019-07-12 08:44:36 +00:00
|
|
|
|
2019-10-06 08:46:23 +00:00
|
|
|
v_color = i_color;
|
|
|
|
v_distance = i_vertPos.z;
|
2019-07-12 08:44:36 +00:00
|
|
|
}
|