Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Importing shader materials

2 REPLIES 2
Reply
Message 1 of 3
steve
1209 Views, 2 Replies

Importing shader materials

I wish to display models (created by Maya) inside a 3D game, where the game engine renders the models as closely to Maya as feasible. Currently we use the FBX SDK to access the models vertex positions and normals and also store basic material properties (diffuse/specular maps) which we can apply to the model inside the game engine.

 

An artist has recently provided an Maya file which has a model which has been set up to look 'cartoony' and as such uses a toon style shader. How would I go about getting this into our game engine? Is the shader (HLSL? GLSL?) stored inside the FBX? If so how do I go about accessing it, and finding out what attributes/uniforms need setting up to be passed to the shader, etc.

 

If it is not possible to access shaders in this manner, could you suggest how we should go about bringing context from Maya into game via FBX files? It would be quite limiting if we can only support the basic material parameters. I am aware it is possible to write custom plugins for Maya, so we could create a custom material node, and write a customer exporter, but the amount of work required for this would make the task problematic (and is one of the reasons we hoped we could use somethign off the shelf like .fbx).

Tags (3)
2 REPLIES 2
Message 2 of 3
hamzamrana
in reply to: steve

Has anyone found an answer to this problem, or any other guidance?

 

Thanks

Message 3 of 3
PAMD76
in reply to: steve

Hi Steve,

 

Something like this should get you the hlsl filename from the FBX material, I haven't tried this from Maya only Max but I'd expect it to work, you might have to use a different define instead of FBXSDK_IMPLEMENTATION_HLSL.

 

        FbxSurfaceMaterial* fbxMaterial = fbxNode->GetMaterial( mtlIndex );


        const FbxImplementation* lImplementation = GetImplementation( fbxMaterial, FBXSDK_IMPLEMENTATION_HLSL );           

        FbxBindingTable const* bindingTable= lImplementation->GetRootTable();
        FbxString shaderFileName = bindingTable->DescAbsoluteURL.Get();

 

Michael

 

Director / Technology Programmer.
Red Wasp Design & Plastic Ant Software

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums