Height map

Started by Pfaber11, October 08, 2022, 09:35:52

Previous topic - Next topic

Pfaber11

Is it possible to smooth height maps as it is in AGK using Pure BASIC. I have asked on the purebasic forum but do not have any answers. I'm really hoping this is possible . Any other ideas on how to acheive rolling hills would be good also . Thanks for reading .
Windows 11 home edition
PureBasic 6.20 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb ssd
HP Desktop; AMD 3700 A10 16GB ram 2 GB graphics card windows 10

Alienhead

#1
Only thing that comes to mind would be to try a gaussian blur on the actual heightmap image and/or increase the terrain detail level ( higher poly = smoother terrain ).  Or you could use a free tool such as https://quadspinner.com/ and export your terrain as a mesh object at any detail level you want.

Coder Apprentice

#2
As Alienhead already suggested:

Increasing the terrain polygon count.  The second parameter of CreateTerrain() called "size". Don't know why. This is where you set the subdivision level of your terrain. Valid values are 1+power of two like 65, 129, 257, 513, 1025, 2049...higher the number the denser (more polygon) the terrain will be. As suggested also try to blur your image if necessary. Creating your own terrain mesh was also a great suggestion. You have much more control over it in a 3D program at the creation stage. You won't get the engine's built in terrain optimizations but that probably won't be an issue at all. Lots of trial and error.

As far as I know PureBasic has no smoothing function for terrains.

Pfaber11

Hi Kris "size" helped a lot and is useful , it nearly gives me what I want and I think with a bit of work and some alterations to the height map itself this will do it. Thanks for all the replies.
Windows 11 home edition
PureBasic 6.20 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb ssd
HP Desktop; AMD 3700 A10 16GB ram 2 GB graphics card windows 10