I have ran into an interesting little problem/bug/annoyance.

I am writing some code where I need to render the same scene multiple times. The first time I just need the z-buffer of the scene and then next time I need the entire scene as "normal". Trying to be a little intelligent about this it was suggested to me that I should rendering the first copy of the scene with materials "dis-abled" by using a material group at the top of the scene with an empty material. (this should make the render action just render the geometry without an materials).

Well, this did not work out so well.

The path I decided to take for this was to just take my normal scene root and then add a new material group as a parent. In the first pass I would render the scene using the material group parent. Then the next pass I would manually tell the viewport to use the normal scene root.

Well, anyway, I didn't get far. It seems that there is a bug so that even if you are rendering for the normal scene root but it has a parent that is a material group, the scene does not get rendered. For example, if you add the following code at the end of the 10loading.cpp tutorial, you will get a black screen. (this probably works in a number of other tutorials too).

OSG::MaterialGroupNodePtr mat_group = OSG::MaterialGroupNodePtr::create();
   OSG::ChunkMaterialPtr chunk_mat = OSG::ChunkMaterial::create();

   OSG::beginEditCP(mat_group);
      mat_group->setMaterial(chunk_mat);
      mat_group.node()->addChild(mgr->getRoot());
   OSG::endEditCP(mat_group);


Anyone have an idea why this happens?

-Allen


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to