2019-10-06 08:07:09 +00:00
|
|
|
#version 120
|
2019-07-12 08:44:36 +00:00
|
|
|
|
|
|
|
varying vec4 v_color;
|
|
|
|
varying float v_distance;
|
|
|
|
|
|
|
|
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;
|
|
|
|
uniform mat4 u_glowMatrix;
|
2019-07-12 08:44:36 +00:00
|
|
|
|
|
|
|
const float c_zero = 0.0;
|
|
|
|
const float c_one = 1.0;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec4 vertex = u_rotMatrix * gl_Vertex;
|
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-06 08:07:09 +00:00
|
|
|
gl_TexCoord[0] = gl_MultiTexCoord0;
|
|
|
|
//gl_TexCoord[0] = mix(gl_TexCoord[0].xyzw, gl_TexCoord[0].yxzw, u_usePalette); WTF is this???
|
2019-07-12 08:44:36 +00:00
|
|
|
|
2019-10-06 08:19:51 +00:00
|
|
|
gl_TexCoord[3] = u_detailMatrix * gl_MultiTexCoord0;
|
|
|
|
gl_TexCoord[4] = u_glowMatrix * gl_MultiTexCoord0;
|
2019-07-12 08:44:36 +00:00
|
|
|
|
|
|
|
gl_FogFragCoord = abs(eyeCoordPosition.z);
|
|
|
|
|
|
|
|
v_color = gl_Color;
|
|
|
|
v_distance = gl_Vertex.z;
|
|
|
|
}
|