Table of Contents

Class MapProperties

Namespace
Gamelogic.Fx.Mapping
Assembly
Gamelogic.Fx.dll

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:

  1. Specify the main map shader via MapProperties.ShaderName.
  2. Optionally specify a background shader via BackgroundShaderName.
  3. Expose serialized fields that control how objects write data into the map.
  4. 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

Color

BackgroundShader

Gets the resolved background shader.

public Shader BackgroundShader { get; }

Property Value

Shader

The background Shader, or null if no background pass is used.

BackgroundShaderName

The name of the shader used to render the background when rendering this object info.

protected virtual string BackgroundShaderName { get; }

Property Value

string

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

material Material

The 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

block MaterialPropertyBlock

The MaterialPropertyBlock used for this draw call.

renderer Renderer

The 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.