Class TerrainBitmapReader
ENGINE: Reads terrain.bmp and converts RGB pixels to terrain type indices Handles both direct BMP palette reading and Unity Texture2D RGB conversion
public class TerrainBitmapReader
- Inheritance
-
objectTerrainBitmapReader
Constructors
TerrainBitmapReader(bool)
public TerrainBitmapReader(bool logProgress = true)
Parameters
logProgressbool
Methods
ConvertRGBToTerrainTypes(Texture2D, TerrainRGBLookup, int, int)
Convert RGB pixels from terrain texture to terrain type indices Uses TerrainRGBLookup to map RGB colors to terrain indices Returns array of terrain indices [y * width + x] = terrainTypeIndex
public uint[] ConvertRGBToTerrainTypes(Texture2D terrainTexture, TerrainRGBLookup rgbLookup, int width, int height)
Parameters
terrainTextureTexture2DrgbLookupTerrainRGBLookupwidthintheightint
Returns
- uint[]
ReadBmpPaletteIndices(string, int, int)
Read raw palette indices from an 8-bit indexed BMP file Bypasses Unity's texture import which converts palette indices to RGB Returns array of palette indices [y * width + x] = paletteIndex
public uint[] ReadBmpPaletteIndices(string bmpPath, int expectedWidth, int expectedHeight)
Parameters
bmpPathstringexpectedWidthintexpectedHeightint
Returns
- uint[]