Remove perspective hack
This commit is contained in:
parent
fa0cb2a5d8
commit
59e600a890
@ -1,6 +1,6 @@
|
||||
#version 330 core
|
||||
|
||||
in vec3 UV;
|
||||
noperspective in vec2 UV;
|
||||
in vec3 NORMAL;
|
||||
flat in vec3 LIGHT;
|
||||
|
||||
@ -23,7 +23,7 @@ void main() {
|
||||
FragColor += vec4(material.color, 1.0);
|
||||
}
|
||||
if (material.usesTex) {
|
||||
FragColor += texture(material.tex, UV.xy / UV.z);
|
||||
FragColor += texture(material.tex, UV);
|
||||
}
|
||||
if (FragColor.w < material.alphaScissor) {
|
||||
discard;
|
||||
|
@ -8,7 +8,7 @@ uniform mat4 MODEL;
|
||||
uniform mat4 VIEW;
|
||||
uniform mat4 PROJECTION;
|
||||
|
||||
out vec3 UV;
|
||||
noperspective out vec2 UV; // PSX use affine texture mapping
|
||||
out vec3 NORMAL;
|
||||
flat out vec3 LIGHT;
|
||||
|
||||
@ -25,7 +25,8 @@ uniform DirectionalLight directionalLight;
|
||||
void main() {
|
||||
vec4 vertex = PROJECTION * VIEW * MODEL * vec4(pos, 1.0);
|
||||
gl_Position = vertex;
|
||||
UV = vec3(uv * vertex.z, vertex.z);
|
||||
|
||||
UV = uv;
|
||||
|
||||
NORMAL = (VIEW * MODEL * vec4(normal, 0.0)).xyz;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user