Glass materials in Content Studio require specific configuration to achieve realistic transparency and light transmission effects. This guide explains how to set up transmissive (glass) materials correctly.
The "Glass" material group is a misnomer. It represents all transmissive materials, not just traditional glass.
Glass is a hard, brittle, translucent, and commonly transparent substance used for window panes, tableware, lenses, and decorative articles.
What the Glass MCode Defines
The Glass MCode defines the surface appearance only. It does not control how light transmits through the glass.
All glass materials transmit and absorb light to varying degrees. For example, red wine bottles absorb most of the red spectrum while transmitting yellow, green, and blue light, creating a greenish appearance.
Light transmission and absorption properties are configured separately using the baseColorFactor.
Glass Finishes
None refers to glass without any special surface treatment or finish.
It retains its natural, transparent look, with no modifications made to alter its appearance.
Molten glass refers to glass in its liquid form, often seen during the glass-blowing or manufacturing process.
Once cooled, the surface might have a smooth, organic, or wavy appearance due to the shaping process while still in this liquid state.
Sandblasted involves blasting the surface of the glass with sand or another abrasive material, creating a roughened, matte surface.
Sandblasting can be used to produce decorative patterns or to make the glass opaque.
Etched glass has been treated with acid or abrasives to create designs or patterns on its surface.
This finish can create both decorative and functional results, such as adding texture while diffusing light. Etching produces a softer, more controlled design compared to sandblasting.
Frosted glass is translucent with a diffused finish that blurs images and scatters light.
This effect is usually achieved by sandblasting or acid etching the surface, giving it a smooth, milky appearance that maintains privacy while still allowing light to pass through.
Ground glass has been mechanically abraded to produce a rough surface.
It is less polished than etched or frosted glass and may be used for similar purposes, such as diffusing light or creating privacy.
Clear glass is fully transparent with no treatments that alter its appearance.
It allows light to pass through unimpeded, making it ideal for windows.
Please see common examples of glass materials in the table below.
| Glass | MCode |
|---|---|
| Clear Glass | Glass.Glass.Clear.None |
| Frosted Glass | Glass.Glass.Frosted.None |
| Clear Plastic | Glass.Plastic.Clear.None |
| Liquid | Glass.Liquid.Clear.None |
Base Color Factor for Glass
The baseColorFactor controls the color and light absorption properties of glass materials. RGB values in range from 0 to 1 are usually used. Alpha value is optional (default: 1.0)
Without a baseColor texture map:
- Values are interpreted as sRGB colorspace
With a baseColor texture map:
- baseColorFactor acts as a linear multiplier of texture values
- Values are interpreted as linear colorspace
Alpha Channel
The alpha value represents material presence/absence, not optical transparency:
0 is absence of material
1.0 is a full presence of material (recommended for real-world materials)
Important: Do not confuse alpha with optical transparency. For transparency, use transmission properties (see Texture Maps section below).
Texture Maps
Texture maps define variations of material properties across the surface geometry. For glass materials, texture maps are recommended for patterns, etching, or sandblasting effects.
Base Color Map
baseColorMap represents the color/albedo (RGB channels) and optionally opacity/transparency (A channel), with 1.0 being fully opaque.
- RGB color values should be in sRGB colorspace
- Texture values are multiplied by the baseColorFactor if present
Transmission Map
transmissionMap defines the transmission percentage of the surface, stored in the R channel. This value is multiplied by transmissionFactor.
Use this map to set the opacity of the glass, including gradients from clear to opaque.
The transmissionFactor is changed from 0.95 to 0.4 on the image below.
Metallic Roughness Map
metallicRoughness map is used to set the roughness of the glass, including gradients from smooth to rough.
- Metallic value is in the B channel
- Roughness value is in the G channel
- R and A channels (if present) are ignored
These values are combined with the metallicFactor and roughnessFactor.
Overriding the MCode
Since an MCode can only set one value in a rendering parameter, you may need to override it using Factors or Textures.
Using Factors
The content model allows overriding the transmissive factor set by the MCode. You can set Glass.Glass.Clear.None but create different versions, as the MCode cannot account for all variations.
Using Texture Maps
For patterns, etching, or sandblasting effects, use texture maps:
metallicRoughness map:
- Set the roughness of the glass
- Include gradients from smooth to rough
transmission map:
- Set the opacity of the glass
- Include gradients from clear to opaque