AlpakaJoe
AlpakaJoe

Reputation: 593

terrainData.heightmapHeight doesn't fit with heightmapResolution

As far as i know the terrainData.heightmapResolution should affect the terrainData.heightmapHeight.

So if i set the terrainData.heightmapResolution to 241, the terrainData.heightmapHeight becomes 257 and i can't figure out why.

if i want to set the terrainData.heightmapResolution to (241 - 16), the terrainData.heightmapHeight still becomes 257.

What i would need is that the terrainData.heightmapHeight becomes 241, but i can't figure out how to do so?

Upvotes: 1

Views: 178

Answers (1)

Ruzihm
Ruzihm

Reputation: 20269

Heightmaps need to have a height and width of a whole power of 2 plus 1.

257 is a valid height/width because 257 = 256 + 1 = 2^8 + 1.

241 is not a valid height/width because there's no integer n such that 241 = 2^n + 1

Upvotes: 1

Related Questions