Game.Rendering.LaneProperty
Assembly:
Assembly-CSharp (Cities: Skylines 2 game assembly)
Namespace:
Game.Rendering
Type:
public enum LaneProperty
Base:
System.Enum
Summary:
LaneProperty is an enum used by the rendering system to identify per-instance shader properties for lane rendering. Each enum value is annotated with an InstanceProperty attribute (name, shader type, batch flags, index, boolean) that maps the enum member to a GPU/instance shader property used by the engine to pass data such as matrices, colors, LOD fade values and flow offsets for each lane instance. The Count member is a sentinel representing the number of entries.
Fields
-
CurveMatrix
InstanceProperty: "colossal_CurveMatrix", type: float4x4, BatchFlags: (none), index: 0, flag: false
Represents the transformation matrix for lane curve geometry (4x4). Used to position/orient per-instance geometry along the lane curve. -
CurveParams
InstanceProperty: "colossal_CurveParams", type: float4, BatchFlags: (none), index: 0, flag: false
Holds per-instance curve parameters (packed into a float4) used by the lane shader for shape/tessellation/offset calculations. -
CurveScale
InstanceProperty: "colossal_CurveScale", type: float4, BatchFlags: (none), index: 0, flag: false
Per-instance scale factors for curve-related effects (packed into a float4). -
InfoviewColor
InstanceProperty: "colossal_NetInfoviewColor", type: float4, BatchFlags: InfoviewColor, index: 0, flag: false
Color used for infoview rendering (when the net/segment is highlighted in the info view); has the InfoviewColor batch flag. -
CurveDeterioration
InstanceProperty: "colossal_CurveDeterioration", type: float4, BatchFlags: (none), index: 0, flag: false
Per-instance deterioration/wear parameters for the curve (packed float4), used by shaders to show damage/age effects. -
OutlineColors
InstanceProperty: "_Outlines_Color", type: float4, BatchFlags: Outline, index: 0, flag: true
Outline color used when rendering outlines; marked with the Outline batch flag and the boolean (true) as in the attribute in the original source. -
LodFade0
InstanceProperty: "colossal_LodFade", type: float, BatchFlags: LodFade, index: 0, flag: false
LOD fade scalar for first LOD layer (index 0). -
LodFade1
InstanceProperty: "colossal_LodFade", type: float, BatchFlags: LodFade, index: 1, flag: false
LOD fade scalar for second LOD layer (index 1). Both LodFade0 and LodFade1 share the same property name but different indices. -
FlowMatrix
InstanceProperty: "colossal_FlowMatrix", type: float4x4, BatchFlags: InfoviewFlow, index: 0, flag: false
Matrix controlling flow visualization (e.g., for traffic/flow overlays) for the infoview flow batch. -
FlowOffset
InstanceProperty: "colossal_FlowOffset", type: float, BatchFlags: InfoviewFlow, index: 0, flag: false
Offset value to animate or shift the flow overlay. -
HangingDistances
InstanceProperty: "colossal_HangingDistances", type: float4, BatchFlags: Hanging, index: 0, flag: false
Used for hanging object distances (packed float4), with the Hanging batch flag. -
ColorMask1
InstanceProperty: "colossal_ColorMask0", type: float4, BatchFlags: ColorMask, index: 0, flag: false
First color mask (note attribute uses "colossal_ColorMask0" naming). -
ColorMask2
InstanceProperty: "colossal_ColorMask1", type: float4, BatchFlags: ColorMask, index: 0, flag: false
Second color mask. -
ColorMask3
InstanceProperty: "colossal_ColorMask2", type: float4, BatchFlags: ColorMask, index: 0, flag: false
Third color mask. -
Count
Sentinel value representing the number of enum entries. Not mapped to an InstanceProperty attribute; used for array sizing / iteration bounds.
Properties
- (none)
This enum defines identifiers only; it does not expose properties. The InstanceProperty metadata is provided via attributes on each enum member and can be accessed via reflection.
Constructors
- (none)
Standard enum backing constructors are generated by the runtime; there are no public constructors to call.
Methods
- (none specific)
Typical enum methods (ToString, CompareTo, HasFlag, etc.) are available from System.Enum/System.ValueType but there are no custom methods defined here.
Usage Example
Example: reading InstanceProperty metadata via reflection to get shader property name and declared type for a given LaneProperty value.
using System;
using System.Reflection;
// Example helper that reads the InstanceProperty attribute attached to an enum member
public static class LanePropertyUtils
{
public static (string shaderName, Type shaderType, object batchFlags, int index, bool flag)?
GetInstancePropertyInfo(LaneProperty prop)
{
var fi = typeof(LaneProperty).GetField(prop.ToString());
if (fi == null) return null;
var attr = fi.GetCustomAttribute(typeof(InstancePropertyAttribute), inherit: false)
as InstancePropertyAttribute;
if (attr == null) return null;
// InstancePropertyAttribute has constructor: (string name, Type type, BatchFlags flags, int index, bool something)
return (attr.PropertyName, attr.PropertyType, attr.Flags, attr.Index, attr.SomeBoolean);
}
}
// Usage
var info = LanePropertyUtils.GetInstancePropertyInfo(LaneProperty.CurveMatrix);
if (info.HasValue)
{
Console.WriteLine($"Shader name: {info.Value.shaderName}, Type: {info.Value.shaderType}");
}
Notes: - The exact InstancePropertyAttribute type name, its property names (PropertyName, PropertyType, Flags, Index, SomeBoolean) and BatchFlags are based on the attribute constructor seen in the source; actual property getters may differ—inspect the game's attribute definition to match exact member names. - Use the enum to index into per-instance buffers or to map engine data to shader properties when writing rendering-related mods or custom shaders.