0027607: Visualization - Implement adaptive screen space sampling in path tracing
[occt.git] / src / OpenGl / OpenGl_SceneGeometry.cxx
index d363629..3864a62 100755 (executable)
@@ -502,6 +502,11 @@ Standard_Boolean OpenGl_RaytraceGeometry::ReleaseTextures (const Handle(OpenGl_C
 // =======================================================================
 Standard_Integer OpenGl_RaytraceGeometry::AddTexture (const Handle(OpenGl_Texture)& theTexture)
 {
+  if (theTexture->TextureId() == OpenGl_Texture::NO_TEXTURE)
+  {
+    return -1;
+  }
+
   NCollection_Vector<Handle (OpenGl_Texture)>::iterator anIter =
     std::find (myTextures.begin(), myTextures.end(), theTexture);