Files
minecraft-pt/shaders/Lib/Programs/Gbuffers/Water_VS.glsl
T

30 lines
729 B
GLSL

// MinecraftPT — Water Vertex Shader
#include "/Lib/Settings.glsl"
#include "/Lib/Utilities.glsl"
out vec2 texcoord;
out vec3 worldPos;
out vec3 worldNormal;
out vec3 vertexNormal;
out vec4 color;
out vec2 lightmap;
void main(){
vec4 viewPos = gl_ModelViewMatrix * gl_Vertex;
vec4 wPos = gbufferModelViewInverse * viewPos;
worldPos = wPos.xyz;
vertexNormal = normalize(gl_NormalMatrix * gl_Normal);
worldNormal = normalize(mat3(gbufferModelViewInverse) * vertexNormal);
lightmap = gl_MultiTexCoord1.xy / 240.0;
lightmap = saturate(lightmap);
texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
color = gl_Color;
gl_Position = gl_ProjectionMatrix * viewPos;
gl_Position.xy += taaJitter * gl_Position.w;
}