Alessandro,
I put the GoogleMode flag into the dae writer in December 2007 after
examing the dae files ouput by Sketchup at that time. Here is the
comment from the SVN log.
8. User can supply an experimental GoogleMode option on output. The
plugin
will try to emulate the way Sketchup specifies transparency (i.e. the
inverse of what it should be!). I am still struggling to get GE to
understand transparency, anyone know what it expects?
Sketchup at that time wrote dae files that did not conform to the
Collada specification. It may or may not still do so, I have not
checked recently. At around the same time I put a check into the dae
reader code to set a flag if the authoring tool field in the collada
header contained the words "Google Sketchup". Have a look at
daeRMaterials.cpp and search for m_AuthoringTool and you will see how
the current reader handles transparency settings it thinks come from
Sketchup. Looking at your osg file below it looks like whatever the the
transparency value was in the incoming dae file the material is
actually being treated as opaque (transparency * constant colour alpha
> 0.99) and not put in the transparent bin. This may not be correct
behaviour any more.
Roger
aalessandro terenzi wrote:
I'm experiencing some problem with collada models and
transparency texture maps. I saw that in May someone had the same
problem but finally I couldn't find a solution. I tried with osg2.2.0
and 2.6.0 and it looks like that transparency doesn't work with collada
models and png texture maps.
I checked Robert's suggestion and converted to .osg to check if
GL_BLEND function was enabled or not and it looks like it is... here
follow a piece of the converted .osg file.
Geode {
name "material10"
nodeMask 0xffffffff
cullingActive TRUE
StateSet {
DataVariance STATIC
rendering_hint DEFAULT_BIN
renderBinMode INHERIT
GL_CULL_FACE OFF
GL_BLEND ON
Material {
ColorMode OFF
ambientColor 0 0 0 1
diffuseColor 0.8 0.8 0.8 1
specularColor 0.33 0.33 0.33 1
emissionColor 0 0 0 1
shininess 20
}
BlendFunc {
source CONSTANT_ALPHA
destination ONE_MINUS_CONSTANT_ALPHA
}
BlendColor {
constantColor 1 1 1 1
}
textureUnit 0 {
GL_TEXTURE_2D ON
Texture2D {
file "images/texture9.png"
wrap_s REPEAT
wrap_t REPEAT
wrap_r CLAMP
min_filter NEAREST_MIPMAP_LINEAR
mag_filter LINEAR
maxAnisotropy 1
borderColor 0 0 0 0
borderWidth 0
useHardwareMipMapGeneration TRUE
unRefImageDataAfterApply TRUE
internalFormatMode USE_IMAGE_DATA_FORMAT
resizeNonPowerOfTwo TRUE
}
}
}
[...gemoterty data follow here...]
Is there something wrong with this file?
Someone talked about a problem in Sketchup with png files,
actually the models I'm dealing with come from Sketchup...is there
really a problem with Sketchup? Someone talked about a 'GoogleMode' in
the collada plugin but it looks like it is an option used for writing
collada files not for reading.
Thank you for any advice or direction.
Alessandro
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
|
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org