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