asam-ev / OpenMATERIAL

3D model exchange format with physical material properties for virtual development, test and validation of automated driving.
https://asam-ev.github.io/OpenMATERIAL/
Mozilla Public License 2.0
11 stars 5 forks source link

Material assignment in 3D models #109

Open ClemensLinnhoff opened 2 weeks ago

ClemensLinnhoff commented 2 weeks ago

Is your feature request related to a problem? Please describe. There needs to be a way to assign a material ID to the geometry which can then be looked up in the OpenMATERIAL mapping table.

Describe the solution you'd like Specify the name of an OpenMATERIAL assignment slot/channel, e.g. openMaterialAssignment

Assignment with a texture:

"openMaterialAssignment": {
    "openMaterialAssignmentTexture": {
        "index": 1
    }

Assignment per mesh:

"openMaterialAssignment": {
    "openMaterialAssignmentValue": [
        5,
        2,
        3,
        7
    ]
}

Describe alternatives you've considered

Specify a suffix for the texture files and look for the same base name as the albedo texture but with a different suffix. But this would only work for textures.

Additional context

Do conventional exporters, e.g. in Blender, support custom channels? Are custom channels like this supported in all the formats (glTF, FBX an USD)?

ClemensLinnhoff commented 2 weeks ago

I will ask our 3D artist to try this out and create an example.

@drsftx73 might also have time to check this out.

ClemensLinnhoff commented 2 weeks ago

It is possible to add custom properties to materials (e.g. in Blender): image

LudwigFriedmann commented 2 weeks ago

UV-Mapping for Albedo texture has to be existant in the 3D model and shall be used for UV-mapping of this specific OpenMATERIAL texture

ipg-sig commented 2 weeks ago

Works with .fbx if you use the Better FBX Exporter AddOn for Blender (looks like a bug in the standard .fbx exporter in Blender) Test_FBX.zip Test file directly exported in Ascii format.

ClemensLinnhoff commented 2 weeks ago

It also works with glTF: Test_glTF.zip

drsftx73 commented 1 week ago

@ClemensLinnhoff can you please post the source blender files as well?

ClemensLinnhoff commented 1 week ago

Unfortunately I don't have the blender file, it was only a quick test during a meeting. But you can just import the glTF to blender. There should not be a difference. All data was exported to glTF without any loss, as far as I see.

ClemensLinnhoff commented 1 day ago

It has to be clearly defined how uv mapping works with the OpenMATERIAL texture.

ClemensLinnhoff commented 1 day ago

We discussed using custom properties and an alternative to put the texture assignment in the OpenMATERIAL asset file. It was decided to use the asset file, because the 3D model file does not have to be changed and different parsers might not support custom properties in 3D models.