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 .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

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.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz