| 250 | } |
| 251 | |
| 252 | FORCE_INLINE void WriteHeight(const TerrainDataUpdateInfo& info, Color32& raw, const float height) |
| 253 | { |
| 254 | const float normalizedHeight = (height - info.PatchOffset) / info.PatchHeight; |
| 255 | const uint16 quantizedHeight = (uint16)(normalizedHeight * MAX_uint16); |
| 256 | |
| 257 | raw.R = (uint8)(quantizedHeight & 0xff); |
| 258 | raw.G = (uint8)((quantizedHeight >> 8) & 0xff); |
| 259 | } |
| 260 | |
| 261 | FORCE_INLINE float ReadNormalizedHeight(const Color32& raw) |
| 262 | { |