Struct LitMaterialDescriptor
Describes the surface of a physically-based Lit material in pipeline-neutral terms:
base color, metallic, smoothness, emission, the PBR texture channels, the surface
blend mode, and whether the material renders double-sided. Passed to
CreateLitMaterial(in LitMaterialDescriptor) to build a
material whose properties are mapped to the active render pipeline's Lit shader (URP,
HDRP, or the Built-in Standard shader).
Inherited Members
Namespace: Scylla.Core.Util
Assembly: ScyllaCore.dll
Syntax
public struct LitMaterialDescriptor
Remarks
The type is a lightweight options value. The recommended authoring path is to start from
Default (which carries sensible non-zero defaults such as mid smoothness and
unit normal scale) and layer changes with the With* helpers, each of which returns
a modified copy:
var desc = LitMaterialDescriptor.Default
.WithBaseColor(Color.red)
.WithMetallic(1f)
.WithSmoothness(0.8f)
.WithAlbedoMap(albedoTexture)
.WithNormalMap(normalTexture);
var material = MaterialUtil.CreateLitMaterial(desc);
URP and Built-in Standard address the metallic and occlusion channels through
separate maps (MetallicGlossMap, OcclusionMap). HDRP packs
them into a single mask map (MaskMap: R = metallic, G = ambient occlusion,
A = smoothness). Supply the channel maps for URP or Standard, or a pre-packed mask map for
HDRP; each is applied only when the active shader exposes the matching property.
Constructors
LitMaterialDescriptor(Color, float, float, Color)
Initializes a new opaque, single-sided LitMaterialDescriptor with the given scalar surface parameters and no textures. Texture, tiling, and surface-mode fields take the same sensible defaults as Default.
Declaration
public LitMaterialDescriptor(Color baseColor, float metallic, float smoothness, Color emissionColor)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | baseColor | The albedo / base color of the surface. |
| float | metallic | The metallic value, clamped to |
| float | smoothness | The smoothness value, clamped to |
| Color | emissionColor | The emissive color. UnityEngine.Color.black disables emission. |
Properties
AlbedoMap
Optional albedo / base color texture. Null leaves the base map unset.
Declaration
public Texture AlbedoMap { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
AlphaCutoff
Declaration
public float AlphaCutoff { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
BaseColor
The albedo / base color of the surface. The alpha channel is used by the transparent and cutout surface modes.
Declaration
public Color BaseColor { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
Default
A neutral opaque dielectric preset: white base color, zero metallic, mid smoothness
(0.5), no emission, no textures, single-sided, and unit normal scale, occlusion
strength, and texture tiling. Use this as the starting point for the With*
helpers rather than a bare new LitMaterialDescriptor(), whose numeric fields
would default to zero.
Declaration
public static LitMaterialDescriptor Default { get; }
Property Value
| Type | Description |
|---|---|
| LitMaterialDescriptor |
DoubleSided
When true, backface culling is disabled so the surface renders from both sides.
Declaration
public bool DoubleSided { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
EmissionColor
The emissive color. UnityEngine.Color.black disables emission; any non-black value enables it.
Declaration
public Color EmissionColor { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
EmissionMap
Optional emission map. Null leaves the emission map unset. Applying a non-null map also enables emission.
Declaration
public Texture EmissionMap { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
MaskMap
Optional pre-packed HDRP mask map (R = metallic, G = ambient occlusion, A = smoothness).
Applied only under HDRP; ignored by URP and Built-in Standard, which use the
separate MetallicGlossMap and OcclusionMap channels.
Declaration
public Texture MaskMap { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
Metallic
The metallic value in the range [0, 1]. Higher values make the surface behave like a metal.
Declaration
public float Metallic { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
MetallicGlossMap
Optional metallic / smoothness map for URP and Built-in Standard (metallic in
RGB, smoothness in alpha). Ignored under HDRP, which uses MaskMap.
Declaration
public Texture MetallicGlossMap { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
NormalMap
Optional tangent-space normal map. Null leaves the normal map unset.
Declaration
public Texture NormalMap { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
NormalScale
The normal map intensity. Ignored when NormalMap is null.
Declaration
public float NormalScale { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
OcclusionMap
Optional ambient occlusion map for URP and Built-in Standard. Ignored under HDRP, which packs AO into MaskMap.
Declaration
public Texture OcclusionMap { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
OcclusionStrength
The ambient occlusion intensity in the range [0, 1]. Ignored when OcclusionMap is null.
Declaration
public float OcclusionStrength { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Offset
The texture offset applied to the albedo map. Defaults to UnityEngine.Vector2.zero.
Declaration
public Vector2 Offset { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Smoothness
The smoothness value in the range [0, 1]. Higher values produce a tighter, glossier specular highlight.
Declaration
public float Smoothness { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Surface
The surface blend mode (opaque, transparent, or cutout).
Declaration
public ScyllaMaterialSurface Surface { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| ScyllaMaterialSurface |
Tiling
The texture tiling (scale) applied to the albedo map. Defaults to UnityEngine.Vector2.one.
Declaration
public Vector2 Tiling { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Methods
WithAlbedoMap(Texture)
Returns a copy of this descriptor with the albedo map replaced.
Declaration
public LitMaterialDescriptor WithAlbedoMap(Texture albedoMap)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | albedoMap | The new albedo map. |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithBaseColor(Color)
Returns a copy of this descriptor with the base color replaced.
Declaration
public LitMaterialDescriptor WithBaseColor(Color baseColor)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | baseColor | The new base color. |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithDoubleSided(bool)
Returns a copy of this descriptor with the double-sided flag replaced.
Declaration
public LitMaterialDescriptor WithDoubleSided(bool doubleSided)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | doubleSided | Whether the surface renders from both sides. |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithEmission(Color)
Returns a copy of this descriptor with the emission color replaced.
Declaration
public LitMaterialDescriptor WithEmission(Color emissionColor)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | emissionColor | The new emission color. UnityEngine.Color.black disables emission. |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithEmissionMap(Texture)
Returns a copy of this descriptor with the emission map replaced.
Declaration
public LitMaterialDescriptor WithEmissionMap(Texture emissionMap)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | emissionMap | The new emission map. |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithMaskMap(Texture)
Returns a copy of this descriptor with the pre-packed HDRP mask map replaced.
Declaration
public LitMaterialDescriptor WithMaskMap(Texture maskMap)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | maskMap | The new HDRP mask map (R = metallic, G = AO, A = smoothness). |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithMetallic(float)
Returns a copy of this descriptor with the metallic value replaced.
Declaration
public LitMaterialDescriptor WithMetallic(float metallic)
Parameters
| Type | Name | Description |
|---|---|---|
| float | metallic | The new metallic value. |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithMetallicMap(Texture)
Returns a copy of this descriptor with the metallic / smoothness map replaced (URP and Standard).
Declaration
public LitMaterialDescriptor WithMetallicMap(Texture metallicGlossMap)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | metallicGlossMap | The new metallic / smoothness map. |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithNormalMap(Texture, float)
Returns a copy of this descriptor with the normal map and its scale replaced.
Declaration
public LitMaterialDescriptor WithNormalMap(Texture normalMap, float normalScale = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | normalMap | The new normal map. |
| float | normalScale | The normal map intensity. Defaults to |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithOcclusionMap(Texture, float)
Returns a copy of this descriptor with the occlusion map and its strength replaced (URP and Standard).
Declaration
public LitMaterialDescriptor WithOcclusionMap(Texture occlusionMap, float occlusionStrength = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | occlusionMap | The new occlusion map. |
| float | occlusionStrength | The occlusion intensity, clamped to |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithSmoothness(float)
Returns a copy of this descriptor with the smoothness value replaced.
Declaration
public LitMaterialDescriptor WithSmoothness(float smoothness)
Parameters
| Type | Name | Description |
|---|---|---|
| float | smoothness | The new smoothness value. |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithSurface(ScyllaMaterialSurface, float)
Returns a copy of this descriptor with the surface blend mode replaced.
Declaration
public LitMaterialDescriptor WithSurface(ScyllaMaterialSurface surface, float alphaCutoff = 0.5)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaMaterialSurface | surface | The new surface blend mode. |
| float | alphaCutoff | The cutoff threshold used by Cutout. Defaults to |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |
WithTiling(Vector2, Vector2)
Returns a copy of this descriptor with the albedo texture tiling and offset replaced.
Declaration
public LitMaterialDescriptor WithTiling(Vector2 tiling, Vector2 offset = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | tiling | The texture tiling (scale). |
| Vector2 | offset | The texture offset. Defaults to UnityEngine.Vector2.zero. |
Returns
| Type | Description |
|---|---|
| LitMaterialDescriptor | A modified copy. |