Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

155 provide example for the material mapping #156

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Examples

This folder contains examples for all file formats defined in ASAM OpenMATERIAL.
This showcases the usage of asset files alongside a 3D model file, the material assignment via mesh or texture, the mapping to material property files als well as the definition of specific property look-up tables.

| File Name | Description |
|--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `checker.png` | Visual texture used in the 3D model. |
| `checker_xom.png` | ASAM OpenMATERIAL assignment texture used to assign different materials to certain parts of the object (texture-based material assignment). |
| `example_asset.gltf/bin` | 3D model file in glTF format, representing the 3D geometry. |
| `example_asset.xoma` | ASAM OpenMATERIAL asset file (.xoma), containing asset metadata and the link to the assignment texture. |
| `example_mapping.xomm` | Material mapping file (.xomm), providing mappings for different material definitions, per mesh or texture color value. |
| `example_material.xomp` | ASAM OpenMATERIAL material property file (.xomp), defining core material characteristics. |
| `example_material_2.xomp` | Second example of an ASAM OpenMATERIAL material property file to showcase the mapping of multiple materials. |
| `example_material_emp.xompt` | Material property look-up table (.xompt), containing electromagnetic properties. |
| `example_material_camera_brdf.xompt` | Material property look-up table (.xompt), containing BRDF data specific to camera sensors. |
| `example_material_lidar_brdf.xompt` | Material property look-up table (.xompt), containing BRDF data specific to lidar sensors. |
| `example_material_radar_brdf.xompt` | Material property look-up table (.xompt), containing BRDF data specific to radar sensors. |
Binary file added examples/checker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/checker_xom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/example_asset.bin
Binary file not shown.
218 changes: 218 additions & 0 deletions examples/example_asset.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
{
"asset":{
"generator":"Khronos glTF Blender I/O v4.2.57",
"version":"2.0"
},
"scene":0,
"scenes":[
{
"name":"Scene",
"nodes":[
0
]
}
],
"nodes":[
{
"mesh":0,
"name":"Cube"
}
],
"materials":[
{
"doubleSided":true,
"name":"Material_Cube",
"pbrMetallicRoughness":{
"baseColorTexture":{
"index":0
},
"metallicFactor":0,
"roughnessFactor":0.5
}
},
{
"doubleSided":true,
"name":"Material_Sphere",
"pbrMetallicRoughness":{
"baseColorFactor":[
0.800000011920929,
0.800000011920929,
0.800000011920929,
1
],
"metallicFactor":0,
"roughnessFactor":0.5
}
}
],
"meshes":[
{
"name":"Cube",
"primitives":[
{
"attributes":{
"POSITION":0,
"NORMAL":1,
"TEXCOORD_0":2
},
"indices":3,
"material":0
},
{
"attributes":{
"POSITION":4,
"NORMAL":5,
"TEXCOORD_0":6
},
"indices":7,
"material":1
}
]
}
],
"textures":[
{
"sampler":0,
"source":0
}
],
"images":[
{
"mimeType":"image/png",
"name":"Asset 1",
"uri":"checker.png"
}
],
"accessors":[
{
"bufferView":0,
"componentType":5126,
"count":16,
"max":[
1,
2,
1
],
"min":[
-1,
0,
-1
],
"type":"VEC3"
},
{
"bufferView":1,
"componentType":5126,
"count":16,
"type":"VEC3"
},
{
"bufferView":2,
"componentType":5126,
"count":16,
"type":"VEC2"
},
{
"bufferView":3,
"componentType":5123,
"count":42,
"type":"SCALAR"
},
{
"bufferView":4,
"componentType":5126,
"count":296,
"max":[
0.999999463558197,
3,
0.9999994039535522
],
"min":[
-0.9999992847442627,
2,
-0.9999986886978149
],
"type":"VEC3"
},
{
"bufferView":5,
"componentType":5126,
"count":296,
"type":"VEC3"
},
{
"bufferView":6,
"componentType":5126,
"count":296,
"type":"VEC2"
},
{
"bufferView":7,
"componentType":5123,
"count":1440,
"type":"SCALAR"
}
],
"bufferViews":[
{
"buffer":0,
"byteLength":192,
"byteOffset":0,
"target":34962
},
{
"buffer":0,
"byteLength":192,
"byteOffset":192,
"target":34962
},
{
"buffer":0,
"byteLength":128,
"byteOffset":384,
"target":34962
},
{
"buffer":0,
"byteLength":84,
"byteOffset":512,
"target":34963
},
{
"buffer":0,
"byteLength":3552,
"byteOffset":596,
"target":34962
},
{
"buffer":0,
"byteLength":3552,
"byteOffset":4148,
"target":34962
},
{
"buffer":0,
"byteLength":2368,
"byteOffset":7700,
"target":34962
},
{
"buffer":0,
"byteLength":2880,
"byteOffset":10068,
"target":34963
}
],
"samplers":[
{
"magFilter":9728,
"minFilter":9984
}
],
"buffers":[
{
"byteLength":12948,
"uri":"example_asset.bin"
}
]
}
15 changes: 8 additions & 7 deletions examples/example_asset.xoma
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "example_car",
"description": "This is an example car asset. It demonstrates how OpenMATERIAL assets work.",
"description": "This is an example asset. It demonstrates how OpenMATERIAL assets work.",
"uuid": "87769375a5109c689af8cc3ad3dd8349",
"assetVersion": "1.0.0",
"openMaterialVersion": "1.0.0",
Expand All @@ -11,22 +11,23 @@
"modelCreationTool": "Blender",
"creationDate": "20240703T101728Z",
"modelingMethod": "Modeled according to images",
"validationDescription": "The dimensions of the vehicle in x, y and z where compared to a real vehicle. They were accurate within a margin of 0.01 m.",
"validationDescription": "Not validated.",
"assetType": "object",
"objectClass": "vehicle",
"objectClass": "other",
"animated": false,
"pbrMaterialWorkflow": "metallic",
"triangleCount": 100000,
"meshCount": 10,
"textureResolutions": ["2K"],
"normalMapFormat": "OpenGL",
"boundingBox": {
"x" : [-2.5, 2.5],
"y" : [-1.1, 1.1],
"z" : [0.0, 1.5]
"x" : [-1, 1],
"y" : [-1, 1],
"z" : [0.0, 3]
}
},
"materialMappingUri": "example_mapping.xomm",
"materialTextureAssignment": [
["example_material_name", "example_texture.png"]
["Material_Cube", "checker_xom.png"]
]
}
7 changes: 3 additions & 4 deletions examples/example_mapping.xomm
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"creationDate": "20240703T101728Z",
},
"materialMapping": [
["material_red", "materials/material_a.xomp", "metal with red paint"],
["rgba:10;50;255;127", "materials/material_a.xomp", "metal with red paint"],
["material_green", "materials/material_b.xomp", "metal with green paint"],
["material_blue", "materials/material_c.xomp", "metal with blue paint"]
["Material_Sphere", "example_material.xomp", "white aluminum"],
["rgba:255;0;0;255", "example_material.xomp", "white aluminum"],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @ClemensLinnhoff i am wondering if we should limit ourself to RGB values here. 24 Bit, 16 Mio values enough for all kinds of MaterialIDs.
I think that the alpha value could be useful for something we plan in OpenMaterial 2.0. But if people now already use the alpha channel for IDs, then its hard to change.
My idea here would be to reserve the alpha channel for the future. Maybe for layered Materials.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding this: we may also want to clarify, that the MaterialID Textures need to be 32Bit RGBA.
or do we want to support 24Bit RGB as well?

["rgba:0;11;255;255", "example_material_2.xomp", "black aluminum"]
]
}
35 changes: 35 additions & 0 deletions examples/example_material_2.xomp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"metadata": {
"name": "another example",
"description": "Second example material to showcase OpenMATERIAL assignment and mapping",
"uuid": "807db46a39654e5d83d43ddebad07dc3",
"materialVersion": "1.0.0",
"creationDate": "20241024T110000Z",
"openMaterialVersion": "1.0.0",
"copyright": "(C) 2023-2024, Example Company",
"license": "MPL-2.0",
"author": "[email protected]"
},
"materialProperties": {
"surfaceRoughness": {
"surfaceHeightRms": 0.5,
"surfaceCorrelationLength": 0.3,
"source": "estimate"
},
"emissivityData": {
"emissivityCoefficient": 0.07,
"temperature": 300.0,
"source": "internet: https://www.engineeringtoolbox.com/emissivity-coefficients-d_447.html"
},
"elasticityData": {
"youngsModulus": 70e9,
"poissonsRatio": 0.35,
"source": "internet: https://en.wikipedia.org/wiki/Aluminium"
},
"densityData": {
"density": 2699.0,
"source": "internet: https://en.wikipedia.org/wiki/Aluminium"
},
"electromagneticPropertiesUri": "example_material_emp.xompt"
}
}
5 changes: 5 additions & 0 deletions schemas/asset_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
"boundingBox"
]
},
"materialMappingUri": {
"type": "string",
"description": "Relative path to a material mapping file (.xomm). In this file, material names from the 3D model file or texture color codes from textures assigned in materialTextureAssignment are linked to OpenMATERIAL property files.",
"pattern": ".*\\.xomm$"
},
"materialTextureAssignment": {
"type": "array",
"description": "Optional array containing material texture assignments. It links material names contained in the 3D model file to OpenMATERIAL assignment textures. In a separate material mapping file, the 'color' values in this texture are linked to OpenMATERIAL property files.",
Expand Down