Class MapProperties
Defines a set of properties used to render a scene map into a texture.
[Serializable]
public abstract class MapProperties : ShaderProperties
- Inheritance
-
MapProperties
- Derived
- Inherited Members
Remarks
A map encodes per-object or per-pixel information (such as IDs, UVs, depth-related data, or custom attributes) into a render texture that can later be consumed by post-processing effects.
MapProperties acts as the configuration layer between map-rendering infrastructure
(such as ObjectInfoRenderer in the built-in pipeline or GLMapRendererFeature in URP)
and the shaders used to generate the map.
Implementations typically:
- Specify the main map shader via MapProperties.ShaderName.
- Optionally specify a background shader via BackgroundShaderName.
- Expose serialized fields that control how objects write data into the map.
- Apply per-material and per-renderer state in the appropriate override methods.
Properties
BackgroundColor
The color used to clear the render texture before any rendering takes place.
public virtual Color BackgroundColor { get; }
Property Value
BackgroundShader
Gets the resolved background shader.
public Shader BackgroundShader { get; }
Property Value
BackgroundShaderName
The name of the shader used to render the background when rendering this object info.
protected virtual string BackgroundShaderName { get; }
Property Value
Remarks
It is OK for this to return null if no background shader is needed, in which the BackgroundColor will appear.
This property should always return the same value during the lifetime of this MapProperties.
Methods
OnEnable()
Called when the map properties are enabled.
public override void OnEnable()
Remarks
The default implementation resolves both the main map shader
(via OnEnable()) and the optional background shader.
Subclasses overriding this method should normally call base.OnEnable().
SetBackgroundMaterialProperties(Material)
Applies background-specific properties to the background material.
public virtual void SetBackgroundMaterialProperties(Material material)
Parameters
materialMaterialThe material created from BackgroundShader.
Remarks
Override this method to configure background shader uniforms such as clear color, gradients, or other map-wide background parameters.
SetRendererProperties(MaterialPropertyBlock, Renderer)
Applies per-renderer properties before drawing a renderer into the map.
public virtual void SetRendererProperties(MaterialPropertyBlock block, Renderer renderer)
Parameters
blockMaterialPropertyBlockThe MaterialPropertyBlock used for this draw call.
rendererRendererThe renderer currently being drawn into the map.
Remarks
Override this method to set renderer-specific data such as object IDs, per-object colors, UV transforms, or custom attributes.