[osg-users] Using visitor to transfer material color to geometry color

Werner Modenbach Werner.Modenbach at texion.eu
Mon Jan 8 10:18:32 PST 2018


OK, I'm answering my own post.
The issue is solved. Sorry for the noise here.

- Werner -

Am 08.01.2018 um 17:11 schrieb Werner Modenbach:
> Hi all,
>
> I'm using gl3 mode in my project by setting
> camera->getGraphicsContext()->getState()->setUseModelViewAndProjectionUniforms(_useGL3);
>
> camera->getGraphicsContext()->getState()->setUseVertexAttributeAliasing(_useGL3);
>
> When loading external 3D scenes created in gl2 mode colors of
> geometries are coded in materials.
> I'm sure there is an easy way to check geometries for existence of
> vertex colors and creating the
> vertex colors if necessary from the material in the StateSet by usage
> of a NodeVisitor.
>
> I did a lot of research but couldn't figure out how to do that.
> In recent git sources I found Roberts patch in Material.cpp
> ********************************
> void Material::apply(State& state) const {
>     state.Color(_diffuseFront.r(), _diffuseFront.g(),
> _diffuseFront.b(), _diffuseFront.a());
> }
> ********************************
> How can I do the same in a NodeVisitor?
>
> Any help is highly appreciated.
>
> - Werner -
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
*TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen*
Phone: +49 241 475757-0
Fax: +49 241 475757-29
Web: http://texion.eu
eMail: info at texion.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180108/92d34717/attachment.html>


More information about the osg-users mailing list