From fee4481ef6637f1536b7f4f534ef2bb1000798bf Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Fri, 19 Nov 2021 22:05:47 +0000 Subject: [PATCH] WS30: Add zUpTransform and modelOffset Uniforms. --- simgear/scene/tgdb/VPBTechnique.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/simgear/scene/tgdb/VPBTechnique.cxx b/simgear/scene/tgdb/VPBTechnique.cxx index d5fcc2be..74e59d56 100644 --- a/simgear/scene/tgdb/VPBTechnique.cxx +++ b/simgear/scene/tgdb/VPBTechnique.cxx @@ -1382,6 +1382,8 @@ void VPBTechnique::applyColorLayers(BufferData& buffer, Locator* masterLocator) stateset->addUniform(atlas.ambient); stateset->addUniform(atlas.diffuse); stateset->addUniform(atlas.specular); + stateset->addUniform(new osg::Uniform("zUpTransform", osg::Matrixf(osg::Matrix::inverse(makeZUpFrameRelative(loc))))); + stateset->addUniform(new osg::Uniform("modelOffset", buffer._transform->getMatrix().getTrans())); } }