Archive 17/01/2023.

Terrain cuts away patches from two sides. Bug?

Bananaft

So, here is my special testing textures. Heightmap and TexBlendingMap:

As you can see, they are coincidental. And I’m expecting to see one texture in the lowlands, and another on the hills.

But if i’m creating terrain in editor, using this two textures, here is how it comes out:

Height map appears larger and cropped on two sides. It cropped by , and changing it will scale this effect.

And to make both textures match, I end up with adding 32 pixels to each side to my heightmap, making it 288x288 instead of 256x256. And that way Urho makes perfect 256x256 terrain:

Why terrain does that? Is it a bug?

cadaver

Terrain heightmap needs an odd number of points so that the mipmapping works properly while the patch edges remain in place. For example 129 x 129, 257 x 257.

Bananaft

Aaaah, of course! Thank you for clarifying that.

Aren’t power of two +1 tex size not cool for memory usage? or that’s true only for textures that used on GPU, and heightmap is not.

cadaver

Heightmap itself does not get loaded to GPU by default (unless you use it in a material), so there the limitation doesn’t matter. Otherwise it’s true that power of two is preferred.