Table of Contents

Class AdditionalLightTable

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

WebGPU: URP's per-light arrays (additional lights, their shadow parameters and slices, their cookies, and the Forward+ reflection probes) gathered once per camera into one storage buffer the lit passes read (FishLightTable.hlsl), so they are no longer members of every lit program's $Globals.

public static class AdditionalLightTable
Inheritance
AdditionalLightTable
Inherited Members

Remarks

On WebGPU URP's lighting cbuffers are plain globals (FishShadowVariants.hlsl: the pipelines must stay within the device's 10 dynamic uniform buffers), which put ~14 KB of arrays into each lit program's $Globals; Unity copies a program's whole $Globals on every pass application, and that copy was the largest engine cost left in the browser (measured 2026-11-03).

The table is not a second account of URP's light setup. A compute kernel (FishLightTableGather, in the profile's terrain-instancing compute, as the depth pyramid's kernels are) declares URP's arrays by URP's names and sizes, so its constants are filled from the very globals URP has just set, and copies them bit for bit. It runs after the shadow passes, when the last of them (the additional lights' shadow parameters and slices) has been set, and before anything is lit; every camera runs its own, so each camera's draws read its own lights.

Fields

KernelName

public const string KernelName = "FishLightTableGather"

Field Value

string

LightRows

public const int LightRows = 12

Field Value

int

Lights

public const int Lights = 32

Field Value

int

Pass

The pass that fills it; enqueued by FishCloudsFeature for every camera (every renderer carries it).

public static readonly ScriptableRenderPass Pass

Field Value

ScriptableRenderPass

ProbeRows

public const int ProbeRows = 11

Field Value

int

Probes

public const int Probes = 32

Field Value

int

RowStride

One uint4 per row.

public const int RowStride = 16

Field Value

int

Rows

Lights, then shadow slices, then probes, then the cookie-enable word.

public const int Rows = 865

Field Value

int

SliceRows

public const int SliceRows = 4

Field Value

int

Properties

Gathers

Cameras gathered (probes and tests).

public static int Gathers { get; }

Property Value

int

Needed

The lit shaders read the table on this device (they are compiled to on WebGPU only).

public static bool Needed { get; }

Property Value

bool

Table

The table, created zeroed and bound globally on first use, so a draw before any gather reads no light.

public static GraphicsBuffer Table { get; }

Property Value

GraphicsBuffer

Methods

EnsureCompute(ComputeShader)

The gather kernel and its compute: the active profile's, or found by path in the editor.

public static bool EnsureCompute(ComputeShader assigned = null)

Parameters

assigned ComputeShader

Returns

bool

Gather(CommandBuffer, GraphicsBuffer)

Records the gather into a command buffer (the pass, and tests that dispatch it by hand).

public static void Gather(CommandBuffer cmd, GraphicsBuffer into)

Parameters

cmd CommandBuffer
into GraphicsBuffer

Release()

public static void Release()