diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-15 17:46:44 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-15 17:46:44 +1000 |
commit | 63c9e3ec8b51a9d96872a054a0d35e8591b3535d (patch) | |
tree | 7d5cfaea0e13eb34cc6db25df6054cae1a04677c /assets/opensb/rendering/effects/world.vert | |
parent | 2a4bd826052102a0bb8858355e42b9cba06f2991 (diff) |
only round vertices if AA is on
[skip ci]
Diffstat (limited to 'assets/opensb/rendering/effects/world.vert')
-rw-r--r-- | assets/opensb/rendering/effects/world.vert | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/assets/opensb/rendering/effects/world.vert b/assets/opensb/rendering/effects/world.vert index ce8a9fc..f41c0a8 100644 --- a/assets/opensb/rendering/effects/world.vert +++ b/assets/opensb/rendering/effects/world.vert @@ -6,6 +6,7 @@ uniform vec2 textureSize2; uniform vec2 textureSize3; uniform vec2 screenSize; uniform mat3 vertexTransform; +uniform bool vertexRounding; uniform vec2 lightMapSize; uniform vec2 lightMapScale; uniform vec2 lightMapOffset; @@ -24,11 +25,13 @@ out vec2 fragmentLightMapCoordinate; void main() { vec2 screenPosition = (vertexTransform * vec3(vertexPosition, 1.0)).xy; - if (((vertexData >> 3) & 0x1) == 1) - screenPosition.x = round(screenPosition.x); - if (((vertexData >> 4) & 0x1) == 1) - screenPosition.y = round(screenPosition.y); - + if (vertexRounding) { + if (((vertexData >> 3) & 0x1) == 1) + screenPosition.x = round(screenPosition.x); + if (((vertexData >> 4) & 0x1) == 1) + screenPosition.y = round(screenPosition.y); + } + fragmentLightMapMultiplier = float((vertexData >> 2) & 0x1); int vertexTextureIndex = vertexData & 0x3; fragmentLightMapCoordinate = (screenPosition / lightMapScale) - lightMapOffset * lightMapSize / screenSize; |