From 0f946abc364b56d6f5d09ba1cec4f795600d51c0 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Tue, 28 Sep 2021 21:38:16 +0100 Subject: [PATCH] WS30: Correct texture coords for roads --- simgear/scene/tgdb/VPBTechnique.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simgear/scene/tgdb/VPBTechnique.cxx b/simgear/scene/tgdb/VPBTechnique.cxx index d9b450d4..38511efc 100644 --- a/simgear/scene/tgdb/VPBTechnique.cxx +++ b/simgear/scene/tgdb/VPBTechnique.cxx @@ -1800,7 +1800,7 @@ void VPBTechnique::generateLineFeature(BufferData& buffer, Locator* masterLocato const osg::Vec3d d = end + spanwise * road._width * 0.5 + up; // Determine the x and y texture coordinates for the edges - const float xTex = 0.5 * road._width / xsize; + const float xTex = 1.0 / xsize; const float yTexA = yTexBaseA + (c-a).length() / ysize; const float yTexB = yTexBaseB + (d-b).length() / ysize; @@ -1819,7 +1819,7 @@ void VPBTechnique::generateLineFeature(BufferData& buffer, Locator* masterLocato t->push_back(osg::Vec2d(xTex, yTexBaseB)); t->push_back(osg::Vec2d(xTex, yTexB)); - t->push_back(osg::Vec2d(0, yTexBaseA)); + t->push_back(osg::Vec2d(0, yTexA)); // Normal is straight from the quad osg::Vec3d normal = -(end-start)^spanwise;