2024-04-11 14:59:46 -04:00
|
|
|
|
|
|
|
#define vWarp 0 // psx vertex warp [0 1 2 4 8 16 32]
|
|
|
|
|
2024-04-11 21:37:40 -04:00
|
|
|
void vertex_warp() {
|
2024-04-11 14:59:46 -04:00
|
|
|
float mod = pixelSize * vWarp;
|
|
|
|
vec2 screen = vec2(viewWidth / mod, viewHeight / mod);
|
|
|
|
vec4 position = gbufferModelViewInverse * gl_ModelViewMatrix * gl_Vertex;
|
2024-04-11 17:08:30 -04:00
|
|
|
vec2 nearest = round(position.xy / position.w * screen) / screen;
|
2024-04-11 14:59:46 -04:00
|
|
|
position.xy = nearest;
|
2024-04-11 17:23:01 -04:00
|
|
|
gl_Position = gl_ProjectionMatrix * gbufferModelView * position;
|
2024-04-11 14:59:46 -04:00
|
|
|
}
|
|
|
|
|