From 2b2c1b5671b7d01f79c5d79a35bf0aa88f562d3b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 25 Nov 2011 09:24:50 +0000 Subject: [PATCH] From Jean-Sebastien Guay, fix for handling texture unit >= 8 and negative LigthNum. --- src/osgShadow/ViewDependentShadowMap.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/osgShadow/ViewDependentShadowMap.cpp b/src/osgShadow/ViewDependentShadowMap.cpp index 6860ad862..68016c704 100644 --- a/src/osgShadow/ViewDependentShadowMap.cpp +++ b/src/osgShadow/ViewDependentShadowMap.cpp @@ -1052,7 +1052,14 @@ void ViewDependentShadowMap::cull(osgUtil::CullVisitor& cv) // pass on shadow data to ShadowDataList sd->_textureUnit = textureUnit; - sdl.push_back(sd); + if (textureUnit >= 8) + { + OSG_NOTICE<<"Shadow texture unit is invalid for texgen, will not be used."<(itr->first.get()); - if (light) + if (light && light->getLightNum() >= 0) { // is LightNum matched to that defined in settings if (settings && settings->getLightNum()>=0 && light->getLightNum()!=settings->getLightNum()) continue;