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
10 stars 5 forks source link

Methods of material assignment #46

Open ClemensLinnhoff opened 1 month ago

ClemensLinnhoff commented 1 month ago

Is your feature request related to a problem? Please describe. Material files need to be linked to the geometry. There are different possibilities to do that. It needs to be decided if the standard should allow multiple mapping solutions and if yes, which ones.

Describe the solution you'd like In the material group the following methods have been discussed:

ClemensLinnhoff commented 1 month ago

Define priority of material mapping methods if multiple are given in a model:

  1. Texture
  2. Vertex
  3. Mesh

The indicator which method is used is the presence of the specified color value in texture, vertex and mesh.

MatthiasThDs commented 1 month ago

It seems that common game engines like Unreal Engine (used at dSPACE), Unity and Unigine doesn't support multiple layers of vertex colors. That would mean: If you want to support OpenMaterial, you may not use Vertex Colors for anything else. It is very common to encode other visual properties in vertex colors, for example the strength of wear and tear effects.

PeteBaker1 commented 1 month ago

It would be interesting to look at how most materials are currently made and what mapping method they use. From our experience, texture mapping seems to be by far the most common and extensive, and when getting mesh assets they almost always come with associated materials, so a mesh mapping method also works. I feel like texture and mesh mapping method are perfectly compatible with each other and not opposing! (if defining mesh mapping as being textures that are applied onto a mesh in a certain way)

PeteBaker1 commented 1 month ago

In terms of all the game engines I had a look at, they seem to predominantly use texture/mesh mapping methods and not the vertex mapping so much, more in niche areas like shaders/lighting.

ClemensLinnhoff commented 1 month ago

@drsftx73 could you elaborate a bit in which engines you use vertex painting for material assignment?

drsftx73 commented 1 month ago

We used unity for this. For any solution - one needs to use a vertex shader inside of the engine. (standard in both unity and unreal). It is possible to have multiple vertex maps included in an fbx or gltf file. with multiple vertex maps, you just need to modify your shader code to use the proper vertex map.

PeteBaker1 commented 1 month ago

So say you have a car in your simulation environment, in Unity you would have it setup as a mesh that has multiple vertex maps within it? rather than a mesh with multiple texture maps?

drsftx73 commented 1 month ago

So say you have a car in your simulation environment, in Unity you would have it setup as a mesh that has multiple vertex maps within it? rather than a mesh with multiple texture maps?

No - you'd would most likely have both. Texture maps allow for a much higher level of detail (for example dirt). Things like dirt, rust, etc. could not properly be assigned via vertex painting. Additionally, usually things like dirt and rust are thought of as "wear and tear" and created procedurally (dynamically) vs. statically.

If we take the three proposed approaches and organize them by fidelity: Assigning materials via individual meshes - lowest fidelity Assigning materials via vertex IDs - mid fidelity Assigning materials via a texture map - highest fidelity

drsftx73 commented 2 weeks ago

vertex colors are simply a vertex attribute type. In most 3d content creation tools, users can assign multiple vertex attributes for any vertex. It is up to the simulator to use the vertex attributes accordingly.

There were some companies who mentioned they are already using vertex colors for something specific in their simulators. Can we get more information on what they are using them for and if it is possible for them to modify their models so we can use vertex colors for material mapping?

@ClemensLinnhoff re: your question about if vertices are shared between different triangles. vertices are not shared between triangles (they are different than points).

ClemensLinnhoff commented 1 week ago

As per the vote shown on 04.09.2024 Vertex colors will not be used for material assignment in OpenMATERIAL v1.0.

ClemensLinnhoff commented 1 week ago

Example of a mapping table inside the asset file:

"material_mapping": [ ["10;50;255;127", "./materials/example_material.xomp", "metal with red paint"] ]

TBD: Should we include either