Subnautica heightmap (spoliers)

tanzanitetanzanite Members Join Date: 2016-10-06 Member: 222904Posts: 4 Fully active user
Wrote some html/javascript to generate heightmaps out of subnautica *.optoctrees (current stable release). Using multiple color gradients to indicate depth.

Boy is it hard to find a color scheme that does not look like a** nor ambiguous :(

Currently using:
. zmapGradient( 160, 196, 196, 255); // depth, red, green, blue
. zmapGradient( 1, 160, 128, 16);
. zmapGradient( -1, 0, 255, 0);
. zmapGradient( -100, 128, 0, 0);
. zmapGradient( -200, 0, 0, 0);
. zmapGradient( -300, 0, 0, 255);
. zmapGradient( -400, 128, 64, 0);
. zmapGradient( -500, 255, 255, 255); // there essentially is nothing below 500
. zmapGradient(-3040, 0, 0, 0);

Any ideas for better gradients?

Current map (~6MB png, the whole 4096x4096) https://lensdump.com/i/6MedT
RalijSnailsAttackTarkannen0x6A7232AvimimusFoxyFrustratedEdgepixel

Comments

  • JackeJacke CalgaryMembers Join Date: 2017-03-20 Member: 229061Posts: 625 Advanced user
    It would be helpful to make a depth colour legend beside the map, starting at 0 and going down with the colour at each depth band beside it.
    The 'e' is silent. BRING BACK "Great job not dying." !!!
  • nesrak1nesrak1 PlacesMembers Join Date: 2016-12-04 Member: 224536Posts: 299 Advanced user
    I know you probably don't know, not on the off chance that you might, do you know how to create a mesh from the optoctrees? I've been struggling to find a way to do that. Really don't know what to do with the density/signed distance value. But I assume you are just taking the positional value of each voxel and not dealing with sd.
  • tanzanitetanzanite Members Join Date: 2016-10-06 Member: 222904Posts: 4 Fully active user
    Did some tinkering and added cave-mode:

    https://lensdump.com/i/6Dqp9 - contains river depth and below (including the deepest Degasi base that leads to one of the entrances)
    https://lensdump.com/i/6DBF2 - contains castle depth and below
    https://lensdump.com/i/6Dd1o - contains lava area and below

    Tried some algorithms to suppress the distracting ledges at cave ceilings, but finally decided against it (tended to hurt other cave detail).

    Oh, and added a legend to the generator - it adds the full gradient and depths to used gradient points.

    Have not found a better gradient set for the main map, so not making a new one yet.
    nesrak1 wrote: »
    I know you probably don't know, not on the off chance that you might, do you know how to create a mesh from the optoctrees? I've been struggling to find a way to do that. Really don't know what to do with the density/signed distance value. But I assume you are just taking the positional value of each voxel and not dealing with sd.
    Have not looked into it. Last i generated meshes from voxel data i used a homebrew method (smoothed and then voxel vertices offset by signed distance respective to the voxels center) - don't know what method Subnautica uses. Some derivative of metaballs perhaps? Yeah, no idea.

    (Not sure what you mean by "sd". But yes, i just use voxel materials directly to determine where matter is)
    RezcaFrustrated
  • nesrak1nesrak1 PlacesMembers Join Date: 2016-12-04 Member: 224536Posts: 299 Advanced user
    edited November 2017
    Sd is signed distance. On the post it says there's a material value and a signed distance value. The code refers to it as density. They said they are using dual contouring, but the examples for dual contouring I've found only calculate density at voxels' vertices or edges, not the center (or wherever the signed distance is being calculated from inside the voxel, it was never specified)
    Post edited by nesrak1 on
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The NetherlandsMembers, NS2 Playtester, Squad Five Blue Join Date: 2003-05-13 Member: 16271Posts: 15,782 Advanced user
    edited November 2017
    Shouldn't this be called "depthmap" :trollface:

    Guardian of the "magic cookiejar" 

    Retired forum Admin, I mostly used a flamethrower tank for disputes... Mostly

    Retired EUPT Deputy | Moral Support | Squad 5 Blue | 102 1HP Skulk escapes and counting

    Jacke0x6A7232
  • RezcaRezca United StatesMembers Join Date: 2016-04-28 Member: 216078Posts: 1,061 Advanced user
    Pretty cool seeing those maps, especially the cave ones ^^
    A Great Jaggi under the sea~

Sign In or Register to comment.