Hi, don't know if this fits in this thread, but I noticed another problem with multipass material. I'm using a MPM to render 2 passes on a geometry, first one renders the shaded faces, the second one adds a wireframe on top. The first material uses vertex colors to render the faces (Colormaterial = GL_AMBIENT_AND_DIFFUSE), that works well. The second material should use the color specified in its MaterialChunk to draw the wireframe. The problem is that independent of what I select for the ColorMaterial value of the second material, the wireframe gets drawn using the vertex colors. The whole material looks like this:
MPM - ChunkMaterial_1 -- MaterialChunk --- Lit = True --- ColorMaterial = GL_AMBIENT_AND_DIFFUSE --- BackColorMaterial = GL_AMBIENT_AND_DIFFUSE - ChunkMaterial_2 -- MaterialChunk --- Diffuse (0.3;0.4;1.0) --- Lit = False --- ColorMaterial = GL_FALSE --- BackColorMaterial = GL_FALSE -- PolygonChunk --- CullFaces GL_NONE --- FrontMode GL_LINE --- BackMode GL_LINE -- LineChunk Hope this helps. Thanks, Michael -------- Original-Nachricht -------- > Datum: Wed, 09 Feb 2011 09:12:32 -0600 > Von: Carsten Neumann <carsten_neum...@gmx.net> > An: opensg-users@lists.sourceforge.net > Betreff: Re: [Opensg-users] MultipassMaterial and PolygonForeground > Hello Josef, > > On 02/09/2011 06:09 AM, Josef Grunig wrote: > > yes, it works fine for me. I said I'm not used to OpenSG coding... ;-) > > ok, thanks for testing. > > > Anyway my code comes from the basis of the > > RenderAction::getMaterialStates() method; probably there might be some > > possible refactoring too. > > yes, I was looking at this too and wondering why it does things in this > convoluted way ;) > > > You may have noticed I've added a GLMatrixMode(GL_PROJECTION) before > > the second last glPopMatrix() in the draw function. > > I did that because I get a GL_STACK_UNDERFLOW when rendering (only in > > the PolygonForeground) some MultipassMaterials. > > I supposed that the state activate or the deactivate of some chunk > > changes somehow the matrix mode to GL_MODELVIEW, while it seems > > expecting GL_PROJECTION > > yes, for example TextureTransformChunk switches to the texture matrix > stack and then back to modelview, I added the glMatrixMode() call. > > Cheers, > Carsten > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Opensg-users mailing list > Opensg-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensg-users -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users