A visitor can be used to apply specific shaders to the parts of a model.
If names were given to parts of the model by the modeling program,
the visitor can look for substrings "_shader_metal", "window", etc,
using osg::Object::getName().

A better way is if modeling programs could output .osg format
with GLSL directly but none do AFAIK (??).


>Hi, I was wondering how models have shaders applied in OSG. Yes I know normally
>+a 3d modeler would know this, but I'm a programmer, not a modeler. More
>+specifically I am wondering how shaders are applied to certain parts of 
>models.
>+An example of this would be applying a shader to say, the metal part of a 
>seat,
>+and another shader to say, the fabric/leather part of a seat. This is 
>something
>+which I'm not sure if it directly applies to the programming end of making an
>+application, and I would really just like to know how it's done in general 
>with
>+OSG.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to