WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   OSG Exporter and no vertex colors (https://forum.worldviz.com/showthread.php?t=4161)

Joran 03-07-2012 05:45 AM

OSG Exporter and no vertex colors
 
Hello,

I have problems with the exported models using the latest version of OSG Exporter (1.0.1). The exporter now seems to assign a white vertex color to all vertices for textured faces. This means I can not change the color anymore using the vizard commands (like .color()). I could not find a method to turn this off or to work around this.

The change that added this can be found here: http://osgmaxexp.svn.sourceforge.net...26&pathrev=228

Greetings, Joran.

farshizzo 03-07-2012 09:10 AM

Hi Joran,

Yes, I made that change because if no vertex color was assigned to a model, it could inherit seemingly random colors, depending on the last applied vertex color value in the scene. This should only be the case if lighting is disabled on the model. With lighting enabled, the .color() command should continue to work properly. Either way, you can use the .clearAttribute() command to remove the vertex colors from a model:
Code:

node.clearAttribute(viz.ATTR_VERTEXCOLOR)
Do you think the exporter should be modified to not assign any vertex colors when the "Vertex Color" option is unchecked?

Joran 03-08-2012 05:50 AM

Hello,

Thank you, the clearAttribute works fine.

I tried out some other things. And if I turn on lighting for the complete model, the .color() command works, as you said.

The clearAttribute solves my problem, but in the model I exported there are also objects without textures. These object are rendered white (with lighting off). So the results are not as expected. I can fix those using clearAttribute.

I am not sure what the behaviour of the exporter should be. I never use VertexColors myself. But I think I would like a way to turn of the this white VertexColor generation, so that even with LIGHTING off the .color() can be used.


All times are GMT -7. The time now is 02:12 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC