WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Tree object (https://forum.worldviz.com/showthread.php?t=3919)

sleiN13 09-15-2011 06:51 AM

Tree object
 
I've got a tree object in my scene with multiple polygons with transparent textures. These polygons aren't all drawn in the correct order causing the front leaves to draw the sky in their transparent parts instead of the leaves behind it.

Is there a way to solve this problem in vizard or during export?

I had this problem before with scene object consisting out of multiple transparent faces where they weren't drawn in the correct order (depth test style) I resolved that by separating the different faces into multiple scene object and let the depth test resolve the draw order problems. But for this tree it going to be to much work.

farshizzo 09-27-2011 11:09 AM

Try enabling viz.SAMPLE_ALPHA_TO_COVERAGE on the tree model. You will need to enable multisampling in order for this to work.
Code:

viz.setMultiSample(8)
viz.go()

model = viz.add('tree.osgb')
model.enable(viz.SAMPLE_ALPHA_TO_COVERAGE)


sleiN13 10-04-2011 12:13 AM

That worked nicely. Still have a little bit of light corners on the leafs but atleast it looks like a actual tree now.

farshizzo 10-04-2011 08:45 AM

I forgot to mention, you should also disable blending when using alpha to coverage. This might fix the issue with the corners:
Code:

model.disable(viz.BLEND)


All times are GMT -7. The time now is 03:48 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC