Zach
I didn't have the obvious transparency that you have but did have some
edge problems. I processed my images with PaintShopPro down to palette
colour and then set appropriate palette colour to transparent (so alpha
would be 0 or 1). I then found setting the transparent backgound colour
to a suitable shade of green removed (or at least hid) all of the edge
artifacts.
Alan Harris
Zach Deedler wrote:
Hi Robert,
Just modifying the texture to have 0 or 1 alpha values didn't work.
Also, I looked at this same tree using VTree (a graphics API), and it
doesn't have the same problem. This is weird because Multigen Creator
_does_ show the problem. So, somehow VTree is doing what we want to
do, without being given any extra information. I know it doesn't just
reject alpha values between 0 and 1 because we have other objects that
have alpha values between 0 and 1 show up just fine (vehicles).
VTree:
I can try changing AlphaFunc, but how can I detect that I want to do
this for only my trees, as VTree does? Anybody know?
Thanks.
Zach
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield
Sent: Wednesday, February 28, 2007 04:21
To: osg users
Subject: Re: [osg-users] Alpha priority
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/
------------------------------------------------------------------------
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/