Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/assets/opensb/rendering/effects/world.vert
diff options
context:
space:
mode:
Diffstat (limited to 'assets/opensb/rendering/effects/world.vert')
-rw-r--r--assets/opensb/rendering/effects/world.vert13
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;