20132177 / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

ViewportLayers + Selective rendering + nested objects results in doubling triangle count #193

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a nested object (a plane nested in a DisplayObject3D for example)
2. Create a viewportlayer for the parent object
3. Add a statsview to your stage to see triangle count
4. Selective render the viewport layer: renderer.renderLayers(scene,
camera, viewport, [objectLayer] );

What is the expected output? What do you see instead?
It increases the amount of triangles used and slows down the application.

What version of the product are you using? On what operating system?
latest trunk

Please provide any additional information below.
This also happens when loading external models. In that case it is quite
problematic, as there might be a lot of nested objects in the model. 
A demo of this problem can be found here:
http://www.paultondeur.com/demos/SelectiveRenderingProblem/
I've enabled sourceview so you can see the exact code that's being used:
http://www.paultondeur.com/demos/SelectiveRenderingProblem/srcview/

The work around is not adding any nested objects to your scene that needs
to be part of the selective render. In case of models that means you should
do something like this:
var teapot:DisplayObject3D = model.getChildByName("Teapot", true);
scene.addChild(teapot);
var layer:ViewportLayer = new ViewportLayer(viewport,null);
viewport.containerSprite.addLayer(layer);
layer.addDisplayObject3D(teapot, true);
renderer.renderLayers(scene, camera, viewport, [layer] );

Original issue reported on code.google.com by p...@paultondeur.nl on 17 May 2009 at 3:14

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'm also encountering this problem with some DAE files.

ViewportLayers are completely useless because of this bug!

I need a fix fast :(

Original comment by kris.vanwallendael on 11 Feb 2010 at 10:49

GoogleCodeExporter commented 8 years ago
Same problem with 3ds models.

Original comment by Maksim.V...@gmail.com on 15 Oct 2010 at 7:48