Hi Jonathan,

On Thu, 2005-03-24 at 15:55 -0500, Jonathan Bard wrote:
> Hi,
> 
> I tried the patch and now it's even worse : it's as if it didn't take
> my
> SHLParameter into account : now, the opacity doesn't reduce, unlike
> before.
> Before, the opacity was OK, but the shader was not applied everywhere
> in the
> scene : when I moved the camera, objects appeared and disappeared, as
> if it
> took the parameter into account somewhere and not elsewhere.
> Any other idea?

Ah, yes, there was a side-effect that I missed. Try the attached patch,
that should fix it.

Hope it helps

        Dirk

-- 
-- Dirk Reiners               OpenSG Forum             [EMAIL PROTECTED] 
-- The OpenSG Open Source Scenegraph:            http://www.opensg.org
-- Announcements:   http://lists.sf.net/lists/listinfo/opensg-announce
Index: OSGSHLChunk.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Experimental/SHL/OSGSHLChunk.cpp,v
retrieving revision 1.30
diff -u -3 -p -r1.30 OSGSHLChunk.cpp
--- OSGSHLChunk.cpp	19 Jan 2005 01:44:06 -0000	1.30
+++ OSGSHLChunk.cpp	28 Mar 2005 18:08:46 -0000
@@ -560,7 +560,8 @@ void SHLChunk::updateProgram(Window *win
 
 void SHLChunk::updateParameters(Window *win,
                                 const MFShaderParameterPtr &parameters,
-                                bool useProgram, bool force)
+                                bool useProgram, bool force,
+                                bool keepProgramActive)
 {
     GLuint program = (GLuint) win->getGLObjectId(getGLId());
 
@@ -728,7 +729,7 @@ void SHLChunk::updateParameters(Window *
         }
     }
 
-    if(useProgram)
+    if(useProgram && !keepProgramActive)
         useProgramObject(0);
 }
 
Index: OSGSHLChunk.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Experimental/SHL/OSGSHLChunk.h,v
retrieving revision 1.15
diff -u -3 -p -r1.15 OSGSHLChunk.h
--- OSGSHLChunk.h	3 Oct 2004 16:42:57 -0000	1.15
+++ OSGSHLChunk.h	28 Mar 2005 18:08:46 -0000
@@ -90,7 +90,8 @@ class OSG_SYSTEMLIB_DLLMAPPING SHLChunk 
     /*! \{                                                                 */
 
     void updateParameters(Window *win, const MFShaderParameterPtr &parameters,
-                          bool useProgram = true, bool force = false);
+                          bool useProgram = true, bool force = false,
+                          bool keepProgramActive = false);
 
     /*! \}                                                                 */
     /*---------------------------------------------------------------------*/
Index: OSGSHLParameterChunk.inl
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Experimental/SHL/OSGSHLParameterChunk.inl,v
retrieving revision 1.3
diff -u -3 -p -r1.3 OSGSHLParameterChunk.inl
--- OSGSHLParameterChunk.inl	2 Sep 2004 13:43:54 -0000	1.3
+++ OSGSHLParameterChunk.inl	28 Mar 2005 18:08:46 -0000
@@ -53,7 +53,7 @@ void SHLParameterChunk::updateParameters
         return;
     }
 
-    shl->updateParameters(win, getParameters(), false, true);
+    shl->updateParameters(win, getParameters(), true, true, true);
 }
 
 OSG_END_NAMESPACE

Reply via email to