Class TileBatchRenderer
public sealed class TileBatchRenderer : IDisposable
- Inheritance
-
objectTileBatchRenderer
- Implements
Constructors
TileBatchRenderer(int, int)
public TileBatchRenderer(int tileSize, int layerCount)
Parameters
TileBatchRenderer(int, int, bool)
public TileBatchRenderer(int tileSize, int layerCount, bool mips)
Parameters
TileBatchRenderer(int, int, bool, TileTextureFormat)
public TileBatchRenderer(int tileSize, int layerCount, bool mips, TileTextureFormat format)
Parameters
tileSizeintlayerCountintmipsboolformatTileTextureFormat
TileBatchRenderer(int, int, int)
public TileBatchRenderer(int tileSize, int layerCount, int instanceCapacity)
Parameters
TileBatchRenderer(int, int, int, bool)
public TileBatchRenderer(int tileSize, int layerCount, int instanceCapacity, bool mips)
Parameters
TileBatchRenderer(int, int, int, bool, TileTextureFormat)
public TileBatchRenderer(int tileSize, int layerCount, int instanceCapacity, bool mips, TileTextureFormat format)
Parameters
tileSizeintlayerCountintinstanceCapacityintmipsboolformatTileTextureFormat
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
tileSizeintlayerCountintinstanceCapacityintmipsbooldecisionTileFormatResolver.ResultdisplacedbooltileFilterModeTileFilterMode
Fields
DisplacedGridN
public const int DisplacedGridN = 32
Field Value
DisplacedVertexCount
public const int DisplacedVertexCount = 6912
Field Value
Properties
BlockCodec
public ITileBlockCodec BlockCodec { get; }
Property Value
BlockCompressed
public bool BlockCompressed { get; }
Property Value
Decision
public TileFormatResolver.Result Decision { get; }
Property Value
Displaced
public bool Displaced { get; }
Property Value
GraphicsFormat
The graphics format actually allocated for this tile array.
public GraphicsFormat GraphicsFormat { get; }
Property Value
- GraphicsFormat
GrowCopiedLayers
public int GrowCopiedLayers { get; }
Property Value
GrowInFlight
public bool GrowInFlight { get; }
Property Value
InstanceCapacity
public int InstanceCapacity { get; }
Property Value
LastDroppedInstances
public int LastDroppedInstances { get; }
Property Value
LayerCount
public int LayerCount { get; }
Property Value
MipCount
public int MipCount { get; }
Property Value
Mips
public bool Mips { get; }
Property Value
PendingLayerCount
public int PendingLayerCount { get; }
Property Value
RequestedTextureFormat
public TileTextureFormat RequestedTextureFormat { get; }
Property Value
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
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
SnapTileSamplesToTexelCenters
Diagnostic only: quantizes flat-map UVs to source texel centers.
public bool SnapTileSamplesToTexelCenters { get; set; }
Property Value
TextureFormat
public TileTextureFormat TextureFormat { get; }
Property Value
TileSizePx
public int TileSizePx { get; }
Property Value
Methods
BeginGrowLayers(int)
public void BeginGrowLayers(int newLayerCount)
Parameters
newLayerCountint
BindGpuUploadTexture(IWebTileDecodeBridge)
public bool BindGpuUploadTexture(IWebTileDecodeBridge webDecode)
Parameters
webDecodeIWebTileDecodeBridge
Returns
BlockStagingBytesForSelfTest(int)
public byte[] BlockStagingBytesForSelfTest(int mipLevel)
Parameters
mipLevelint
Returns
- byte[]
ContinueGrowCopy(Stopwatch, double)
public bool ContinueGrowCopy(Stopwatch sw, double budgetMs)
Parameters
Returns
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
cbCommandBufferrowXVector4rowYVector4rowWVector4heightArrayTexture2DArrayaltCoefVector2skirtDepthMercfloat
GrowLayers(int)
public void GrowLayers(int newLayerCount)
Parameters
newLayerCountint
ProbeBc1Supported(bool, bool)
public static bool ProbeBc1Supported(bool requested, bool allowDecodeOffload = true)
Parameters
Returns
ProbeTextureFormat(TileTextureFormat, bool)
public static TileTextureFormat ProbeTextureFormat(TileTextureFormat requested, bool mips)
Parameters
requestedTileTextureFormatmipsbool
Returns
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
rowXVector4rowYVector4rowWVector4heightArrayTexture2DArrayaltCoefVector2skirtDepthMercfloat
SetFog(float, float, Color)
Sets the horizon fade this renderer draws with.
public void SetFog(float startViewDistance, float endViewDistance, Color color)
Parameters
startViewDistancefloatView distance where the fade begins, in multiples of the camera distance - the same units as the shader's clip w.
endViewDistancefloatView distance where the fade is complete. At or below
startViewDistancethe fade is switched off.colorColorColor 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
instancesTileInstanceDisplacedGpu[]countint
SetInstances(TileInstanceDisplacedGpu[], int, TileInstanceDisplacedGpu[], int)
public void SetInstances(TileInstanceDisplacedGpu[] opaque, int nOpaque, TileInstanceDisplacedGpu[] fading, int nFading)
Parameters
opaqueTileInstanceDisplacedGpu[]nOpaqueintfadingTileInstanceDisplacedGpu[]nFadingint
SetInstances(TileInstanceGpu[], int)
public void SetInstances(TileInstanceGpu[] instances, int count)
Parameters
instancesTileInstanceGpu[]countint
SetInstances(TileInstanceGpu[], int, TileInstanceGpu[], int)
public void SetInstances(TileInstanceGpu[] opaque, int nOpaque, TileInstanceGpu[] fading, int nFading)
Parameters
opaqueTileInstanceGpu[]nOpaqueintfadingTileInstanceGpu[]nFadingint
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
colorColorColor 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
modeTerrainDebugViewMode
Remarks
Same call shape as SetFog(float, float, Color): allocation-free, idempotent, takes effect on the next Render(Vector4, Vector4, Vector4, Texture2DArray, Vector2, float) or FillCommandBuffer(CommandBuffer, Vector4, Vector4, Vector4, Texture2DArray, Vector2, float).
UploadTile(int, Color32[])
public void UploadTile(int layer, Color32[] pixels)
Parameters
layerintpixelsColor32[]
UploadTileBlocks(int, TileBlockPayload)
public void UploadTileBlocks(int layer, TileBlockPayload payload)
Parameters
layerintpayloadTileBlockPayload
UploadTileGpu(int, Texture2D)
public void UploadTileGpu(int layer, Texture2D decoded)
Parameters
layerintdecodedTexture2D