Hi Chris,

> osg::ref_ptr<osg::Texture2D> texture = model->GetEmbeddeFBXTexture();

I think you have to write NodeVisitor that will traverse your model and
extract the Texture from the StateSet. But you can also work with the
texture that is mapped in your FBX model. I didn't followed your
conversation with Robert on this topic, but maybe you just put in your
shader the texture unit to which the texture is assigned?

On Tue, Jan 27, 2015 at 1:50 PM, Chris Hidden <ch...@erghis.com> wrote:

> Ok so now back to the original intent with this question.
>
> So I can now attach a texture to my hand model with a vertex and fragment
> shader, which is great!  I load the texture via its file path and send it
> along to the shaders.
>
> However I was hoping to find a way to do this in a different workflow.  I
> have been and would like to continue to do a fair amount of the texture
> work in 3D Studio Max.  So when I export an FBX model and load it into the
> scene graph it under "normal" circumstances retains its embedded texture
> and displays accordingly.
>
> Is there a way I can access these textures for the FBX model, so that I
> could in some way load the texture directly from the model.
>
> So if I have
> osg::ref_ptr<osg::Node> model = osgDB::readNodeFile("myModel.fbx);
>
> Then I would like to acheive this somehow (Pseudo Code):
>
> osg::ref_ptr<osg::Texture2D> texture = model->GetEmbeddeFBXTexture();
>
> That way we could have a nice system that will take whatever our designers
> or modelers texture the model with directly through the code instead of
> having to manually switch in the code later on.
>
> Im sure this can be done one way or another.  Is there a somewhat simple
> approach to this?
> Thank you!
>
> Cheers,
> Chris
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=62492#62492
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to