From 2bbf92ad5ae7708bf18ac7ef333e9a979d8d1bde Mon Sep 17 00:00:00 2001 From: Uneven Prankster Date: Thu, 16 Nov 2023 21:12:27 -0300 Subject: Working so hard like a soldier Can't afford a thing on TV --- assets/shaders/ps1vert.vs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 assets/shaders/ps1vert.vs (limited to 'assets/shaders/ps1vert.vs') diff --git a/assets/shaders/ps1vert.vs b/assets/shaders/ps1vert.vs new file mode 100644 index 0000000..7d8d506 --- /dev/null +++ b/assets/shaders/ps1vert.vs @@ -0,0 +1,26 @@ +#version 330 + +in vec3 vertexPosition; +in vec2 vertexTexCoord; +in vec3 vertexNormal; +in vec4 vertexColor; + +uniform mat4 mvp; + +noperspective out vec2 fragTexCoord; +noperspective out vec3 fragColor; + +void main() +{ + vec2 res = vec2(160.0, 120.0); + fragTexCoord = vertexTexCoord; + fragColor = vertexColor.rgb; + + vec4 pop = mvp*vec4(vertexPosition, 1.0); + gl_Position = pop; + gl_Position.xyz = pop.xyz / pop.w; + gl_Position.xy = floor(res * gl_Position.xy) / res; + gl_Position.xyz *= pop.w; + + fragColor = mix(fragColor, vec3(0.0), clamp(smoothstep(20.0, 24.0, length(pop.xyz)), 0.0, 1.0)); +} \ No newline at end of file -- cgit v1.2.3