Created: January 27, 2024 Updated: January 27, 2024
This tutorial shows how to use Load Unity RAW files correctly. (Download File Example)
Editor Case :
In some cases, the terrain will not be generated correctly, For example, when exporting the raw file from Photoshop the options are IMB or Macintosh + Interleaved and Non-Interleaved, also there are tow data extensions for RAW files 8bit and 16bit Greyscale.
When you set a RAW file into the terrain field, new fields will appear:
Depth : Determines how many bits Unity uses per pixel in the imported or exported heightmap.
• Bit 16: Uses 16 bits (2 bytes)
• Bit 8: Uses 8 bits (1 byte)
Byte Order : Determines how Unity orders the bytes for each pixel
in the imported or exported heightmap. This mainly applies to bit–16 depth heightmaps, and is platform-dependent.
Depth 16 bit, Byts Order = Windows
Terrain not generated correctly
Terrain generated correctly for Depth=16 bit and Byts Order = Mac
Runtime Case :
From GISTerrainLoaderRuntimePrefs.cs we can play with these values :
RuntimePrefs.Raw_Depth = RawDepth.Bit16;
RuntimePrefs.Raw_ByteOrder = RawByteOrder.Mac;