I've imported Blender FBX models in to UE4 before, so I'm aware that some of the material information is saved in the model. How do I go about accessing this in MonoGame?

To be clear, I don't specifically mean textures. I mean the materials that then refer to a given set of textures (colour, normal, etc).

I'm currently parsing the same texture to the HLSL shader for the entire model, however I want to be able to change which texture is parsed based on the material information (or parse all textures to the shader and have it choose, I'm not sure)

EDIT: it would seem this information is saved in the FBX as "LayerElementMaterial"

LayerElementMaterial: 0 {
        Version: 101
        Name: ""
        MappingInformationType: "ByPolygon"
        ReferenceInformationType: "IndexToDirect"
        Materials: 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,

The question still stands, is this information accessible at runtime?


It would seem the only way to do this is to have the vertex colours correspond to a particular material (which wouldn't work as materials are set per face not per vertex) or completely re-write the FBX importer to take materials into account

As far as I can tell it's otherwise impossible


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.