The value returned by ReadPixel is in Integer RGB format. Meaning the Red, Green and Blue values need to be extracted from the value returned by ReadPixel and averaged to create the terrain height.
For Local xxx = 0 To TERRAIN_SIZE-1 For Local zzz = 0 To TERRAIN_SIZE-1 Local pix:Int = ReadPixel(Terrain.HeightMap,xxx,zzz) Local red:Int = ( pix Shr 16 ) & $FF local green:Int = ( pix Shr 8 ) & $FF Local blue:int = pix & $FF Local height:Int = (red+green+blue)/3 Terrain.Height[xxx,zzz] = height Next NextYou may need to reposition the terrain a bit to be able to see it better.