Hello.
I am trying to change the GL state (backface culling, blending,...) ,
for a whole sub-graph.
(I found the ChunkMaterial / MaterialChunk names a bit confusing, but I
think that I now understand the chunks. quite.)
I made a first version, with a traversal, to test backface culling
activation. It works, but I have to add a PolygonChunk to all the
Material instances in the sub-graph.
So I tried another version, with a MaterialGroup as a main node for the
sub-graph, and it fails. Isn't a MaterialGroup a GL state modificator
for all his childs ?
If it is, is there a bug in the code I used ?
PolygonChunkPtr newChunk = PolygonChunk::create();
beginEditCP(newChunk, PolygonChunk::CullFaceFieldMask);
newChunk -> setCullFace(GL_BACK);
endEditCP(newChunk, PolygonChunk::CullFaceFieldMask);
ChunkMaterialPtr cm = ChunkMaterial::create();
beginEditCP(cm);
cm -> addChunk(newChunk);
endEditCP(cm);
MaterialGroupPtr mg = MaterialGroup::create();
beginEditCP(mg);
mg -> setMaterial(cm);
endEditCP(mg);
_mainNode = Node::create();
beginEditCP(_mainNode) ;
_mainNode->addChild(scene);
_mainNode->setCore( mg ) ;
endEditCP(_mainNode) ;
scene is a node pointer and is set via SceneFileHandler
Thanks in advance for answers
--
Frédéric Devillers ([EMAIL PROTECTED])
Ingénieur à l'Irisa, Rennes, France
Projet Siames, niveau orange, bureau E120, tel (0)2 99 84 25 62
http://fragmoscaphe.net (site personnel)
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users