diff --git a/simgear/scene/material/Effect.cxx b/simgear/scene/material/Effect.cxx index aa221fcc..3736782a 100644 --- a/simgear/scene/material/Effect.cxx +++ b/simgear/scene/material/Effect.cxx @@ -1157,7 +1157,7 @@ struct DepthBuilder : public PassAttributeBuilder const SGPropertyNode* pfar = getEffectPropertyChild(effect, prop, "far"); if (pfar) - depth->setZFar(pnear->getValue()); + depth->setZFar(pfar->getValue()); const SGPropertyNode* pmask = getEffectPropertyChild(effect, prop, "write-mask"); if (pmask)