Hi Zach,
I have to second Joakim's analysis, that its the alpha value in
between 0 and 1.0 that will be causing problems in this case.
Normally depth sorting of transparent objects can sort the blending
out, but with X trees like this its not possible with out breaking
them up into lots of separate geometry, something which would be real
bad for performance.
A couple of tricks you could deploy are:
1) Use a AlphaFunc setting that rejects all alpha values below 1.0.
This would stop alpha blending, but fix the problem of seeing
through the tree.
2) Fix the above by drawing the trees twice, once with AlphaFunc as
in 1.0 and drop
these first pass trees into the opaque bin, then a second pass
that let AlphaFunc
reject only alpha equal to 0 and enable blending, and place in
the transparent bin.
This is more expensive, but does at least introduce blending back in.
3) A variation of 2, is to do two pass but place both in successive
opaque bins, the
second pass with blending on should be after the main opaque bin.
This could be slightly cheaper than 2 as it'll avoid transparent
bin sorting and
minimize the state changes. You could also batch the trees.
Quality might be
slightly down on 2) in certain viewing positions, but it'll be a
lot better than what
you have right now.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/