Table of Contents

Class MapRenderer<TMapProperties>

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

Renders maps using a command buffer and a dedicated camera.

[ExecuteInEditMode]
public class MapRenderer<TMapProperties> : MapRenderer where TMapProperties : MapProperties, new()

Type Parameters

TMapProperties

The type of map properties used to configure the map rendering.

Inheritance
GLMonoBehaviour
MapRenderer<TMapProperties>
Derived
Inherited Members
GLMonoBehaviour.FindObjectsOfInterface<TInterface>()
GLMonoBehaviour.FindRequiredObjectOfType<T>()
GLMonoBehaviour.GetRequiredComponent<T>()
GLMonoBehaviour.GetRequiredComponentInChildren<T>()
MonoBehaviour.IsInvoking()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.runInEditMode
Component.GetComponent<T>()
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentsInParent<T>()
Component.transform
Component.gameObject
Component.tag
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.name
Object.hideFlags

Remarks

A map encodes scene information in a texture that can be used by post effects.

To use a map renderer (a concrete subclass of this generic class):

  1. Add the component to a GameObject in your scene.
  2. Configure the properties.

To render your own type of map:

  1. Create a shader that can render the information you need.
  2. (Optional) Create a background shader to render the background of the map.
  3. Create a new class inheriting from MapProperties, that sets up the material properties for your shader (and background shader if needed).
  4. Create extend from MapRenderer<TMapProperties> class using your new MapProperties type as the generic parameter. Generally the class can be empty (a concrete type is needed to show up in the inspector).

If your camera properties change (through animation or scripting) you need to set Gamelogic.Fx.BuiltIn.Mapping.MapRenderer<TMapProperties>.updateCameraEachFrame to true. You may need to set the execution order to make sure this script executes after the code that updates the camera.

If your source camera itself changes, you set SourceCamera.

Properties

LayerMask

Gets and sets the layer mask used to select which objects are rendered into the map.

public LayerMask LayerMask { get; set; }

Property Value

LayerMask

MapProperties

Gets the map properties for this map renderer.

public TMapProperties MapProperties { get; }

Property Value

TMapProperties

SourceCamera

Gets and sets the source camera used to render the map.

public Camera SourceCamera { get; set; }

Property Value

Camera

UpdateCameraEachFrame

Gets and sets whether to update the camera properties each frame.

public bool UpdateCameraEachFrame { get; set; }

Property Value

bool

UpdateRenderListEachFrame

Gets and sets whether to update the list of renderers each frame in playmode.

public bool UpdateRenderListEachFrame { get; set; }

Property Value

bool

UpdateRenderListEachFrameInEditor

Gets and sets whether to update the list of renderers each frame in edit mode. This only has an effect when not playing.

public bool UpdateRenderListEachFrameInEditor { get; set; }

Property Value

bool

Methods

RefreshRendererList()

Updates the list of renderers to be drawn.

public void RefreshRendererList()

Remarks

This can potentially be slow, so be careful calling it each frame.