Skip to content

Commit 1eb99cd

Browse files
Merge pull request #222314 from FlorianBorn71/UpdatedGLTFProperties
Updated all material properties, clear distinction between runtime property and conversion override property
2 parents 0f22ce4 + 640ab22 commit 1eb99cd

File tree

4 files changed

+105
-75
lines changed

4 files changed

+105
-75
lines changed

articles/remote-rendering/how-tos/conversion/override-materials.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ The full JSON schema for materials files is given here. Except for `unlit` and `
202202
"albedoColor": { "$ref": "#/definitions/colorOrAlpha" },
203203
"roughness": { "type": "number" },
204204
"metalness": { "type": "number" },
205+
"normalMapScale": { "type": "number" },
205206
"transparent": { "type" : "boolean" },
206207
"alphaClipEnabled": { "type" : "boolean" },
207208
"alphaClipThreshold": { "type": "number" },

articles/remote-rendering/overview/features/color-materials.md

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,59 @@ ms.topic: article
99

1010
# Color materials
1111

12-
*Color materials* are one of the supported [material types](../../concepts/materials.md) in Azure Remote Rendering. They are used for [meshes](../../concepts/meshes.md) that should not receive any kind of lighting, but rather be full brightness at all times. This might be the case for 'glowing' materials, such as car dashboards, light bulbs, or for data that already incorporates static lighting, such as models obtained through [photogrammetry](https://en.wikipedia.org/wiki/Photogrammetry).
12+
*Color materials* are one of the supported [material types](../../concepts/materials.md) in Azure Remote Rendering. They're used for [meshes](../../concepts/meshes.md) that shouldn't receive any kind of lighting, but rather always appear at full brightness. This might be the case for 'glowing' materials, such as car dashboards, light bulbs, or for data that already incorporates static lighting, such as models obtained through [photogrammetry](https://en.wikipedia.org/wiki/Photogrammetry).
1313

1414
Color materials are more efficient to render than [PBR materials](pbr-materials.md) because of their simpler shading model. They also support different transparency modes.
1515

16-
## Common material properties
16+
## Color material properties
1717

18-
These properties are common to all materials:
18+
The following material properties are exposed in the runtime API, for instance on the [C# ColorMaterial class](/dotnet/api/microsoft.azure.remoterendering.colormaterial) or the [C++ ColorMaterial class](/cpp/api/remote-rendering/colormaterial), respectively.
1919

20-
* **albedoColor:** This color is multiplied with other colors, such as the *albedoMap* or *:::no-loc text="vertex"::: colors*. If *transparency* is enabled on a material, the alpha channel is used to adjust the opacity, with `1` meaning fully opaque and `0` meaning fully transparent. Default is white.
20+
* `ColorFlags`: Miscellaneous feature flags can be combined in this bit mask to enable the following features:
21+
* `UseVertexColor`: If the mesh contains :::no-loc text="vertex"::: colors and this option is enabled, the mesh's :::no-loc text="vertex"::: color is multiplied into the `AlbedoColor` and `AlbedoMap`. By default `UseVertexColor` is disabled.
22+
* `DoubleSided`: If double-sidedness is set to true, triangles with this material are rendered even if the camera is looking at their back faces. By default this option is disabled. See also [:::no-loc text="Single-sided"::: rendering](single-sided-rendering.md).
23+
* `AlphaClipped`: Enables hard cut-outs on a per-pixel basis, based on the alpha value being below the value of `AlphaClipThreshold` (see below). This works for opaque materials as well.
24+
* `TransparencyWritesDepth`: If the `TransparencyWritesDepth` flag is set on the material and the material is transparent, objects using this material will also contribute to the final depth buffer. See the color material property `ColorTransparencyMode` in the next section. Enabling this feature is recommended if your use case needs a more plausible [late stage reprojection](late-stage-reprojection.md) of fully transparent scenes. For mixed opaque/transparent scenes, this setting may introduce implausible reprojection behavior or reprojection artifacts. For this reason, the default and recommended setting for the general use case is to disable this flag. The written depth values are taken from the per-pixel depth layer of the object that is closest to the camera.
25+
* `FresnelEffect`: This material flag enables the additive [fresnel effect](../../overview/features/fresnel-effect.md) on the respective material. The appearance of the effect is governed by the other fresnel parameters `FresnelEffectColor` and `FresnelEffectExponent` explained below.
26+
* `AlbedoColor`: This color is multiplied with other colors, such as the `AlbedoMap` or *:::no-loc text="vertex"::: colors*. If *transparency* is enabled on a material, the alpha channel is used to adjust the opacity, with `1` meaning fully opaque and `0` meaning fully transparent. The default albedo color is opaque white.
2127

2228
> [!NOTE]
2329
> Since color materials don't reflect the environment, a fully transparent color material becomes invisible. This is different for [PBR materials](pbr-materials.md).
2430
25-
* **albedoMap:** A [2D texture](../../concepts/textures.md) for per-pixel albedo values.
26-
27-
* **alphaClipEnabled** and **alphaClipThreshold:** If *alphaClipEnabled* is true, all pixels where the albedo alpha value is lower than *alphaClipThreshold* won't be drawn. Alpha clipping can be used even without enabling transparency and is much faster to render. Alpha clipped materials are still slower to render than fully opaque materials, though. By default alpha clipping is disabled.
28-
29-
* **textureCoordinateScale** and **textureCoordinateOffset:** The scale is multiplied into the UV texture coordinates, the offset is added to it. Can be used to stretch and shift the textures. The default scale is (1, 1) and offset is (0, 0).
31+
* `AlbedoMap`: A [2D texture](../../concepts/textures.md) for per-pixel albedo values.
3032

31-
* **useVertexColor:** If the mesh contains :::no-loc text="vertex"::: colors and this option is enabled, the meshes' :::no-loc text="vertex"::: color is multiplied into the *albedoColor* and *albedoMap*. By default *useVertexColor* is disabled.
33+
* `AlphaClipThreshold`: If the `AlphaClipped` flag is set on the `ColorFlags` property, all pixels where the albedo alpha value is lower than the value of `AlphaClipThreshold` won't be drawn. Alpha clipping can be used even without enabling transparency and is much faster to render. Alpha clipped materials are still slower to render than fully opaque materials, though. By default alpha clipping is disabled.
3234

33-
* **isDoubleSided:** If double-sidedness is set to true, triangles with this material are rendered even if the camera is looking at their back faces. By default this option is disabled. See also [:::no-loc text="Single-sided"::: rendering](single-sided-rendering.md).
35+
* `TexCoordScale` and `TexCoordOffset`: The scale is multiplied into the UV texture coordinates, the offset is added to it. Can be used to stretch and shift the textures. The default scale is (1, 1) and offset is (0, 0).
3436

35-
* **TransparencyWritesDepth:** If the TransparencyWritesDepth flag is set on the material and the material is transparent, objects using this material will also contribute to the final depth buffer. See the color material property *transparencyMode* in the next section. Enabling this feature is recommended if your use case needs a more plausible [late stage reprojection](late-stage-reprojection.md) of fully transparent scenes. For mixed opaque/transparent scenes, this setting may introduce implausible reprojection behavior or reprojection artifacts. For this reason, the default and recommended setting for the general use case is to disable this flag. The written depth values are taken from the per-pixel depth layer of the object that is closest to the camera.
37+
* `FresnelEffectColor`: The fresnel color used for this material. Only important when the fresnel effect flag has been set on this material (see above). This property controls the base color of the fresnel shine (see [fresnel effect](../../overview/features/fresnel-effect.md) for a full explanation). Currently only the RGB-channel values are important and the alpha value will be ignored.
3638

37-
* **FresnelEffect:** This material flag enables the additive [fresnel effect](../../overview/features/fresnel-effect.md) on the respective material. The appearance of the effect is governed by the other fresnel parameters explained in the following.
39+
* `FresnelEffectExponent`: The fresnel exponent used for this material. Only important when the fresnel effect flag has been set on this material (see above). This property controls the spread of the fresnel shine. The minimum value 0.01 causes a spread across the whole object. The maximum value 10.0 constricts the shine to only the most grazing edges visible.
3840

39-
* **FresnelEffectColor:** The fresnel color used for this material. Only important when the fresnel effect bit has been set on this material (see above). This property controls the base color of the fresnel shine (see [fresnel effect](../../overview/features/fresnel-effect.md) for a full explanation). Currently only the rgb-channel values are important and the alpha value will be ignored.
40-
41-
* **FresnelEffectExponent:** The fresnel exponent used for this material. Only important when the fresnel effect bit has been set on this material (see above). This property controls the spread of the fresnel shine. The minimum value 0.01 causes a spread across the whole object. The maximum value 10.0 constricts the shine to only the most gracing edges visible.
42-
43-
## Color material properties
41+
* `VertexMix`: This value between `0` and `1` specifies how strongly the :::no-loc text="vertex"::: color in a [mesh](../../concepts/meshes.md) contributes to the final color. At the default value of 1, the :::no-loc text="vertex"::: color is multiplied into the albedo color fully. With a value of 0, the :::no-loc text="vertex"::: colors are ignored entirely.
4442

45-
The following properties are specific to color materials:
43+
* `ColorTransparencyMode`: Contrary to [PBR materials](pbr-materials.md), color materials distinguish between different transparency modes:
4644

47-
* **vertexMix:** This value between `0` and `1` specifies how strongly the :::no-loc text="vertex"::: color in a [mesh](../../concepts/meshes.md) contributes to the final color. At the default value of 1, the :::no-loc text="vertex"::: color is multiplied into the albedo color fully. With a value of 0, the :::no-loc text="vertex"::: colors are ignored entirely.
45+
* `Opaque`: The default mode disables transparency. Alpha clipping is still possible, though, and should be preferred, if sufficient.
46+
* `AlphaBlended`: This mode is similar to the transparency mode for PBR materials. It should be used for see-through materials like glass.
47+
* `Additive`: This mode is the simplest and most efficient transparency mode. The contribution of the material is added to the rendered image. This mode can be used to simulate glowing (but still transparent) objects, such as markers used for highlighting important objects.
4848

49-
* **transparencyMode:** Contrary to [PBR materials](pbr-materials.md), color materials distinguish between different transparency modes:
49+
## Color material overrides during conversion
5050

51-
1. **Opaque:** The default mode disables transparency. Alpha clipping is still possible, though, and should be preferred, if sufficient.
52-
53-
1. **AlphaBlended:** This mode is similar to the transparency mode for PBR materials. It should be used for see-through materials like glass.
51+
A subset of color material properties can be overridden during model conversion through the [material override file](../../how-tos/conversion/override-materials.md).
52+
The following table shows the mapping between runtime properties documented above and the corresponding property name in the override file:
5453

55-
1. **Additive:** This mode is the simplest and most efficient transparency mode. The contribution of the material is added to the rendered image. This mode can be used to simulate glowing (but still transparent) objects, such as markers used for highlighting important objects.
54+
| Material property name | Property name in override file|
55+
|:----------------------------|:---------------------|
56+
| `ColorFlags.AlphaClipped` | `alphaClipEnabled` |
57+
| `ColorFlags.UseVertexColor` | `useVertexColor` |
58+
| `ColorFlags.DoubleSided` | `isDoubleSided` |
59+
| `ColorFlags.TransparencyWritesDepth` | `transparencyWritesDepth` |
60+
| `AlbedoColor` | `albedoColor` |
61+
| `TexCoordScale` | `textureCoordinateScale` |
62+
| `TexCoordOffset` | `textureCoordinateOffset` |
63+
| `ColorTransparencyMode` | `transparent` |
64+
| `AlphaClipThreshold` | `alphaClipThreshold` |
5665

5766
## API documentation
5867

@@ -65,4 +74,5 @@ The following properties are specific to color materials:
6574

6675
* [PBR materials](pbr-materials.md)
6776
* [Textures](../../concepts/textures.md)
68-
* [Meshes](../../concepts/meshes.md)
77+
* [Meshes](../../concepts/meshes.md)
78+
* [Material override files](../../how-tos/conversion/override-materials.md).

0 commit comments

Comments
 (0)