diff --git a/src/osg/TransferFunction.cpp b/src/osg/TransferFunction.cpp index 4e5763e91..56c5a32d4 100644 --- a/src/osg/TransferFunction.cpp +++ b/src/osg/TransferFunction.cpp @@ -87,6 +87,10 @@ void TransferFunction1D::assignToImage(float lower_v, const osg::Vec4& lower_c, if (end_iPos < 0) return; if (end_iPos > endPos) end_iPos = endPos; + // clamp to ends to avoid any precision issues + if (lower_v == minimum) start_iPos = 0; + if (upper_v == maximum) end_iPos = endPos; + //OSG_NOTICE<<"TransferFunction1D::assignToImage[lower_v="<