- Home /
heightmap resolution and terraindata.getalphamaps
I have a question about heightmap resolution and terraindata.getalphamaps. From what I understand, terraindata.getalphamaps is supposed to return a portion of the map from my active terrain.
I have a terrain 2'000 in width and 2'000 in height, but with a 512 heightmap resolution (making the alphamap 512x512). I try to read out of the 512x512 but get an error (ex: getalphamaps(513,513,1,1) would return an out of bounds (513,513) error, but getalphamaps(511,511,1,1) would return properly), so I upped my heightmap resolution to 2048x2048 and it works, but I have to read 2048 for a proper return from the right most edge of the map (being 2000, since that's my map width).
I am curious, since I started working with .getalphamaps due to everyone using it to get the terrain below the player - how do I properly bind it to my map width/height rather then my alphamap width/height. If I try using it to generate a sound effect while walking on grass or dessert or conrete, I'd be all over the place unless my heightmap resolution and mapsize were the same.
Thanks for the help in advance.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Terrain Assets Error!! 1 Answer
Adding custom trees in UnityTerrain. 1 Answer