Hello Johannes, On 03/07/2013 02:20 AM, Johannes wrote: > commitChanges() is called and the rebuildState() function is also > called. But I can't find the place where the parent ChunkMaterial chunk > list is populated. > > In SimpleMaterial's rebuildState() the _materialChunk is updated and > added to the _pState member. Additionally, the parent's > addChunks(_pState) function is called which populates the _pState with > the parent's chunks found in the _mfChunks container. > > However, the _mfChunks of the parent is never changed and that is > actually what is evaluated in the MaterialChunkOverrideGroup > renderEnter() function. Maybe the implementation of this function does > make wrong assumptions about the chunks container content?
hmm, it seems to me MaterialChunkOverrideGroup should iterate over the chunks of the State returned by PrimeMaterial::getState(). That would also make it work with materials not derived from ChunkMaterial. This is made a bit tricky by the fact that State does not allow easy iteration over it's contained chunks. > As a side note I have discovered that I did have the very same problem > back in 2010 and side stepped it then. > > http://www.mail-archive.com/opensg-users@lists.sourceforge.net/msg12698.html > > Dirk did explain the reason but I must confess that it is not clear to > me right now. Originally the idea was that there are many different types derived from Material (not ChunkMaterial!) each maintaining a State object (per pass). ChunkMaterial was intended for one off cases where a specific combination of OpenGL states was needed and it was not worth the effort to write a separate material. In a strict sense SimpleMaterial should not derive from ChunkMaterial; it does so because it is occasionally convenient to extend a SimpleMaterial with one more extra chunk to achieve a desired effect, but the chunks SimpleMaterial creates internally are not meant to leak to the outside (which they would if added to ChunkMaterial's chunk list). Cheers, Carsten ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users