35 lines
856 B
GLSL
35 lines
856 B
GLSL
// MinecraftPT — Entities 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;
|
|
flat out int blockId;
|
|
flat out float blockLightLevel;
|
|
|
|
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);
|
|
|
|
blockId = int(mc_Entity.x + 0.5);
|
|
blockLightLevel = at_midBlock.w;
|
|
|
|
texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
|
|
color = gl_Color;
|
|
|
|
gl_Position = gl_ProjectionMatrix * viewPos;
|
|
gl_Position.xy += taaJitter * gl_Position.w;
|
|
}
|