Height maps

Started by Pfaber11, March 02, 2021, 09:34:07

Previous topic - Next topic

Pfaber11

I have been using height maps for quite a while but have never taken much notice of the parameter at the end split which I leave at 0 . What I was wanting to know is if I set it to say 4 which would set it to 4x4 would it make my terrain 16 times bigger.? 
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

blinkok

No, it will split it into 16 meshes. Presumably making it faster for collision and GetObjectHeightMapHeight()
I guess it's a bit like making it tile based internally

Pfaber11

oh right I'll have a play with it and see what I think . thanks for the answer.
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

Pfaber11

Good evening . I have tried to use the split in the height map code but It doesn't seem to do anything at all . Here's what I've tried .
CreateObjectFromHeightMap(10,"paul21.png" ,1024,40,1024,2,5)
I thought it might give me a denser terrain but appears to do nothing . Has it got a purpose?
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

blinkok

As i said before. It splits the object into multiple meshes.
You can use GetObjectNumMeshes() to determine the number of meshes in an object.
I am not 100% sure but i think it helps in culling (Only processing the visible meshes), GetObjectHeightMapHeight() and collision.

Pfaber11

Done a bit of experimenting and setting it to 4 on a 1024x1024 height map and I get an increase by 5 or 10 fps compared to setting it to 1 . If I set it to 20 then it slows it down by about 20fps . Anyway will be setting it to 4 on this size of terrain as that seems to work best . Thanks for the info blinkok .
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