On Tue, 2006-10-10 at 19:45 -0700, Farshid Lashkari wrote:
> Hi Drew,
>
> On 10/10/06, Drew Whitehouse <[EMAIL PROTECTED]> wrote:
> > Can someone knowledgeable take a look at this collada file and it's .osg
> > equivalent and tell me why nothing is showing up in osgviewer ? It looks
> > like it should, and osgviewer is reporting the existence of 800+
> > primitives. The .dae file is being exported from 3DSMax, and converted
> > using osgconv/OSG1.2.
>
> The material's alpha is set to 0 in the osg file, so it is 100%
> transparent. Change the alpha values to 1 and it should show up fine.
> It worked here.
I think that points to a bug in the OSG importer since the test file has
RGB_ZERO opacity set:
<diffuse>
<color> 0.988235 0.909804 0.019608 0 </color>
</diffuse>
<transparent opaque="RGB_ZERO">
<color> 1.000000 1.000000 1.000000 1.000000 </color>
</transparent>
<transparency>
<float> 0 </float>
</transparency>
Looking at the code, I see that the function
daeReader::processColorOrTextureType() doesn't handle the opaque
attribute.
~~~
In RGB_ZERO opaque mode you compute per component transparency blending:
result.r = fb.r * (transparent.r * transparency) + mat.r *
(1.0f - transparent.r * transparency)
result.g = fb.g * (transparent.g * transparency) + mat.g *
(1.0f - transparent.g * transparency)
result.b = fb.b * (transparent.b * transparency) + mat.b *
(1.0f - transparent.b * transparency)
Plugging in the mat values for the diffuse component we get:
result.rgb = [ 0.988235 0.909804 0.019608 ]
... the material color replaces the framebuffer (fb) color opaquely.
Regards,
Marcus
--
Mark Barnes
COLLADA Project Lead, tel:+1.650.655.7342
Sony Computer Entertainment America
http://research.scea.com
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/