Table of Contents

Class TileBatchRenderer

Namespace
LansMap.Map.Rendering
public sealed class TileBatchRenderer : IDisposable
Inheritance
object
TileBatchRenderer
Implements

Constructors

TileBatchRenderer(int, int)

public TileBatchRenderer(int tileSize, int layerCount)

Parameters

tileSize int
layerCount int

TileBatchRenderer(int, int, bool)

public TileBatchRenderer(int tileSize, int layerCount, bool mips)

Parameters

tileSize int
layerCount int
mips bool

TileBatchRenderer(int, int, bool, TileTextureFormat)

public TileBatchRenderer(int tileSize, int layerCount, bool mips, TileTextureFormat format)

Parameters

tileSize int
layerCount int
mips bool
format TileTextureFormat

TileBatchRenderer(int, int, int)

public TileBatchRenderer(int tileSize, int layerCount, int instanceCapacity)

Parameters

tileSize int
layerCount int
instanceCapacity int

TileBatchRenderer(int, int, int, bool)

public TileBatchRenderer(int tileSize, int layerCount, int instanceCapacity, bool mips)

Parameters

tileSize int
layerCount int
instanceCapacity int
mips bool

TileBatchRenderer(int, int, int, bool, TileTextureFormat)

public TileBatchRenderer(int tileSize, int layerCount, int instanceCapacity, bool mips, TileTextureFormat format)

Parameters

tileSize int
layerCount int
instanceCapacity int
mips bool
format TileTextureFormat

TileBatchRenderer(int, int, int, bool, Result, bool, TileFilterMode)

public TileBatchRenderer(int tileSize, int layerCount, int instanceCapacity, bool mips, TileFormatResolver.Result decision, bool displaced = false, TileFilterMode tileFilterMode = TileFilterMode.Automatic)

Parameters

tileSize int
layerCount int
instanceCapacity int
mips bool
decision TileFormatResolver.Result
displaced bool
tileFilterMode TileFilterMode

Fields

DisplacedGridN

public const int DisplacedGridN = 32

Field Value

int

DisplacedVertexCount

public const int DisplacedVertexCount = 6912

Field Value

int

Properties

BlockCodec

public ITileBlockCodec BlockCodec { get; }

Property Value

ITileBlockCodec

BlockCompressed

public bool BlockCompressed { get; }

Property Value

bool

Decision

public TileFormatResolver.Result Decision { get; }

Property Value

TileFormatResolver.Result

Displaced

public bool Displaced { get; }

Property Value

bool

GraphicsFormat

The graphics format actually allocated for this tile array.

public GraphicsFormat GraphicsFormat { get; }

Property Value

GraphicsFormat

GrowCopiedLayers

public int GrowCopiedLayers { get; }

Property Value

int

GrowInFlight

public bool GrowInFlight { get; }

Property Value

bool

InstanceCapacity

public int InstanceCapacity { get; }

Property Value

int

LastDroppedInstances

public int LastDroppedInstances { get; }

Property Value

int

LayerCount

public int LayerCount { get; }

Property Value

int

MipCount

public int MipCount { get; }

Property Value

int

Mips

public bool Mips { get; }

Property Value

bool

PendingLayerCount

public int PendingLayerCount { get; }

Property Value

int

RequestedTextureFormat

public TileTextureFormat RequestedTextureFormat { get; }

Property Value

TileTextureFormat

SampleArrayViaTexture2D

Diagnostic only, and too expensive to ship on: samples each visible array layer through one plain Texture2D copy, isolating Texture2DArray sampling from all other tile rendering work.

public bool SampleArrayViaTexture2D { get; set; }

Property Value

bool

SnapFlatMapToSourceTexelGrid

Diagnostic only: aligns a flat integer-zoom raster draw to the source texel grid instead of the device-pixel grid.

public bool SnapFlatMapToSourceTexelGrid { get; set; }

Property Value

bool

SnapTileSamplesToTexelCenters

Diagnostic only: quantizes flat-map UVs to source texel centers.

public bool SnapTileSamplesToTexelCenters { get; set; }

Property Value

bool

TextureFormat

public TileTextureFormat TextureFormat { get; }

Property Value

TileTextureFormat

TileSizePx

public int TileSizePx { get; }

Property Value

int

Methods

BeginGrowLayers(int)

public void BeginGrowLayers(int newLayerCount)

Parameters

newLayerCount int

BindGpuUploadTexture(IWebTileDecodeBridge)

public bool BindGpuUploadTexture(IWebTileDecodeBridge webDecode)

Parameters

webDecode IWebTileDecodeBridge

Returns

bool

BlockStagingBytesForSelfTest(int)

public byte[] BlockStagingBytesForSelfTest(int mipLevel)

Parameters

mipLevel int

Returns

byte[]

ContinueGrowCopy(Stopwatch, double)

public bool ContinueGrowCopy(Stopwatch sw, double budgetMs)

Parameters

sw Stopwatch
budgetMs double

Returns

bool

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FillCommandBuffer(CommandBuffer, Vector4, Vector4, Vector4, Texture2DArray, Vector2, float)

public void FillCommandBuffer(CommandBuffer cb, Vector4 rowX, Vector4 rowY, Vector4 rowW, Texture2DArray heightArray = null, Vector2 altCoef = default, float skirtDepthMerc = 0)

Parameters

cb CommandBuffer
rowX Vector4
rowY Vector4
rowW Vector4
heightArray Texture2DArray
altCoef Vector2
skirtDepthMerc float

GrowLayers(int)

public void GrowLayers(int newLayerCount)

Parameters

newLayerCount int

ProbeBc1Supported(bool, bool)

public static bool ProbeBc1Supported(bool requested, bool allowDecodeOffload = true)

Parameters

requested bool
allowDecodeOffload bool

Returns

bool

ProbeTextureFormat(TileTextureFormat, bool)

public static TileTextureFormat ProbeTextureFormat(TileTextureFormat requested, bool mips)

Parameters

requested TileTextureFormat
mips bool

Returns

TileTextureFormat

Render(Vector4, Vector4, Vector4, Texture2DArray, Vector2, float)

public void Render(Vector4 rowX, Vector4 rowY, Vector4 rowW, Texture2DArray heightArray = null, Vector2 altCoef = default, float skirtDepthMerc = 0)

Parameters

rowX Vector4
rowY Vector4
rowW Vector4
heightArray Texture2DArray
altCoef Vector2
skirtDepthMerc float

SetFog(float, float, Color)

Sets the horizon fade this renderer draws with.

public void SetFog(float startViewDistance, float endViewDistance, Color color)

Parameters

startViewDistance float

View distance where the fade begins, in multiples of the camera distance - the same units as the shader's clip w.

endViewDistance float

View distance where the fade is complete. At or below startViewDistance the fade is switched off.

color Color

Color distant tiles fade toward.

Remarks

Allocation-free and idempotent; call it once per frame from the view that owns this renderer. Not calling it at all leaves the fade off.

SetInstances(TileInstanceDisplacedGpu[], int)

public void SetInstances(TileInstanceDisplacedGpu[] instances, int count)

Parameters

instances TileInstanceDisplacedGpu[]
count int

SetInstances(TileInstanceDisplacedGpu[], int, TileInstanceDisplacedGpu[], int)

public void SetInstances(TileInstanceDisplacedGpu[] opaque, int nOpaque, TileInstanceDisplacedGpu[] fading, int nFading)

Parameters

opaque TileInstanceDisplacedGpu[]
nOpaque int
fading TileInstanceDisplacedGpu[]
nFading int

SetInstances(TileInstanceGpu[], int)

public void SetInstances(TileInstanceGpu[] instances, int count)

Parameters

instances TileInstanceGpu[]
count int

SetInstances(TileInstanceGpu[], int, TileInstanceGpu[], int)

public void SetInstances(TileInstanceGpu[] opaque, int nOpaque, TileInstanceGpu[] fading, int nFading)

Parameters

opaque TileInstanceGpu[]
nOpaque int
fading TileInstanceGpu[]
nFading int

SetRevealTint(Color)

Sets the tint a newly revealed tile lerps away from while it fades in over screen area nothing else covers.

public void SetRevealTint(Color color)

Parameters

color Color

Color drawn at the moment of first reveal; the real tile image fully replaces it once its fade completes.

Remarks

Allocation-free and idempotent, same call shape as SetFog(float, float, Color). Optional: the default already looks correct without calling this - use it only to match a map's own theme (for example, passing the same color given to SetFog(float, float, Color)).

SetTerrainDebugView(TerrainDebugViewMode)

Sets the diagnostic overlay TileQuadDisplaced.shader's Frag draws instead of the sampled basemap color; off by default and not a buyer-facing feature.

public void SetTerrainDebugView(TerrainDebugViewMode mode)

Parameters

mode TerrainDebugViewMode

Remarks

UploadTile(int, Color32[])

public void UploadTile(int layer, Color32[] pixels)

Parameters

layer int
pixels Color32[]

UploadTileBlocks(int, TileBlockPayload)

public void UploadTileBlocks(int layer, TileBlockPayload payload)

Parameters

layer int
payload TileBlockPayload

UploadTileGpu(int, Texture2D)

public void UploadTileGpu(int layer, Texture2D decoded)

Parameters

layer int
decoded Texture2D