I tried to set TRANSPARENT_BIN rendering hint but this didn't solve the
problem.
But I noticed another difference instead.
First I tried this:
- created a box in 3dsmax with a png texture applied in the diffuse slot
- exported using osgexp (keeping the original texture file, ie png)
- osgconv to get a .dae model
- osgviewer of the .dae model
and transparency is correctly handled.
Then I created a similiar model with the same texture with Sketchup, created
a .dae and converted into .osg. I compared the 'correct' .osg with the .osg
'from' Sketchup and I noticed that there is a difference in the BlendFunc
section, in particular:
in the correct .osg file:
BlendFunc {
source SRC_ALPHA
destination ONE_MINUS_SRC_ALPHA
}
and in the not-working file:
BlendFunc {
source CONSTANT_ALPHA
destination ONE_MINUS_CONSTANT_ALPHA
}
Changing these two lines make the transparency work as expected even in the
model that comes from Sketchup.
Accidently I also noticed that converting from .dae to .osg and back to
.dae, result in the textures being completely transparent!
Regards.
Alessandro
On Sat, Nov 15, 2008 at 1:22 PM, Jean-Sébastien Guay <
[EMAIL PROTECTED]> wrote:
> Hi Alessandro,
>
> If you change this:
>
> rendering_hint DEFAULT_BIN
>>
>
> to this:
>
> rendering_hint TRANSPARENT_BIN
>
> and then load the file in osgviewer, does that work?
>
> The two things you need to get proper transparency is enabling GL_BLEND and
> giving the TRANSPARENT_BIN rendering hint, so that the drawables are depth
> sorted. The .osg file you had seemed to have only one of the two. This may
> indicate a bug in the Collada loader.
>
> Hope this helps,
>
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay [EMAIL PROTECTED]
> http://www.cm-labs.com/
> http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org