Citando Drew Whitehouse <[EMAIL PROTECTED]>: > Hi Mark, > > I wondered if that transparent setting had anything to do with things. > Does it make sense to have this for a material that is a simple > non-transparent phong material ? I'm thinking the exporter is being > overly general in this case, we don't really need to set up blending for > a simple material like this ? > > BTW I'm searching for the definition of the "opaque" attribute for > <transparent> and it doesn't seem to be documented in the 1.4.1 > specification. Any pointers ? > > Looking at daeRMaterials.cpp, it seems that a bit of refactoring is > necessary to handle this cleanly. And I guess this particular situation > needs to be treated as a special case, to obviate the need for a > blending state. I notice there is a daeReader::processTransparentType() > method that is going some way towards this. > > -Drew > > [EMAIL PROTECTED] wrote: > > >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 > > > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ >
__________________________________________________ Tecgraf/PUC-Rio Webmail _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
