markcwm / openb3d.mod

OpenB3D BlitzMax wrapper, see openb3d.docs for examples
18 stars 7 forks source link

Question: Terrain LOD setting #22

Closed Hezkore closed 3 years ago

Hezkore commented 4 years ago

Is there a way to change the dynamic terrain LOD? I feel like it's a bit aggressive, and things just in front of the player always appears very blocky.

markcwm commented 4 years ago

Yes, but not until today's commit 91f337fb749c7391b9776e63515c822df26cb968. TerrainDetail was discussed on the OpenB3D FB thread page 17+18. I tried to change ROAM_LMAX but that just reduces the number of levels of detail, so I read the last post on page 17, I messed with that line and have a proper TerrainDetail function now. I updated CreateTerrain/LoadTerrain for testing, detail_level is a percent but values above 100 are valid although it's not very noticeable.

Hezkore commented 4 years ago

Nice work! And it's quite the improvement. Though I still notice quite a lot of shape shifting going on close to the camera. For example this tiny hill changes shape quite rapidly, and it's pretty close by and TerrainDetail is set to 200. 2020-07-31_05-35-45 Is there some way to set where the detail "starts to drop", if that makes sense? I'd like to keep TerrainDetail fairly low, but I'd like everything within ~10 "meters" from the camera at full detail.

markcwm commented 4 years ago

That's strange I can't reproduce that, but I have tweaked the algorithm a bit so now it's not a percentage and the maximum is 2000, this was the value where values became INF. I would think for maximum detail you would want something around 500, the default is 100 which is quite low density, your value of 200 should be [400] now, I get no [visible] popping near the camera at this density. I suggest you increase the detail a bit more until you get another level of detail then it should not be noticeable. I don't know how to control the distance the LOD changes at [fix in next post].

markcwm commented 4 years ago

I added a TerrainRange function to set "where the detail starts to drop" or as the docs put it "to alter the pop/switch distance" see 9a546cf9fd97c314b25c5fb7b5eaf67f7afbf0f6. It's nothing fancy just a pivot parented to the camera then positioned ahead of it, it's maximum value is 100 but I think 50 is as far as you'd want it to go.