My Terrain Test - Basic Trenches

SirSmokeSirSmoke Join Date: 2013-07-05 Member: 185952Members
Thank you UWE and @SteveRock‌ for making this nice little tool publicly available! Here are some pics of my early experiments with trenching. The initial plan was to get some deep continuous lines out of the Perlin noise. This is commonly done by isolating the midrange of standard noise output, which results in "noodles." I then tried various adjustments to the profile (sort of like gamma correction) to produce a steep dropoff with a small bit of curvature. Some regular noise on top is used for changing materials and adding a little more 3d variation.

This noodle technique is a very basic one that provides curvy lines which are not terribly interesting. Much more can be done; one thing that comes to mind is the use of Voronoi or Worley patterns to make the cliff walls look scooped out by currents. I have some other ideas for making more realistic forms, like tapered scars and branching rifts, that I shall try in the future. So far this code generates noise only 3 times, and does not use DoAlgorithmicPass.

Step 1: Cook Spaghetti
UeYltDw.jpg

Tried a mesa-like drop. Also began at large scale, but it's so hard to see an epic chasm at these draw distances.
xE8hAGu.jpg

Started scaling down to see more at once. Not really trenches anymore, but rather clusters of rock mounds.
rD3UvpO.jpg

Added 3D noise for tunnels and arches.
KbodR1W.jpg

Comments

  • SteveRockSteveRock Join Date: 2012-10-01 Member: 161215Members, NS2 Developer, Subnautica Developer
    good stuff! I really dig the spaghetti. I've seen some cool caves in StarForge, where it looks like perlin noisey spaghetti on the walls..I wonder how they do that...
  • SteveRockSteveRock Join Date: 2012-10-01 Member: 161215Members, NS2 Developer, Subnautica Developer
    and yeah, Max and I will be tackling the draw distance optimizations pretty soon.
  • SirSmokeSirSmoke Join Date: 2013-07-05 Member: 185952Members
    Right on. No complaint from me though; when playing, one shouldn't see very far anyway lest the illusion of water density be broken. It'll be nice to have capability to render farther out, if only from a development perspective to know better what one is creating. And the overall performance gain of course. Keep up the great work!

    Speaking of water density, might the GUI contain a slider for fog in a later release? I'm curious to swim around with fog fading in closer to the camera, as right now it's like crystal-clear water that abruptly turns murky. A gradual fade would feel more like real water.

    I've seen a bit of StarForge footage but haven't tried it myself. I don't think I've seen their noodly cave walls, but I did see a cave texture that looked very much like Worley noise.

    For those interested in the math: As for the way I made spaghetti, it's all about the middle value. Because Perlin noise generates blobs at regular distances with a fairly even distribution of values, one can assume that the areas in between the blobs flows continuously, and that the value of those areas tends to be at the center of the spectrum. As Unity's noise implementation returns values from zero to one, the center is 0.5. So one could do something as simple as this:
    float noise = Mathf.PerlinNoise(x*frequency, z*frequency);
    noise = ( noise > 0.45f && noise < 0.55f ) ? 1f : 0f;
    

    ... which would push the values within 5% of center up to one, and the rest down to zero. If you want noodles without hard edges, you can interpolate in various ways. Squaring the proximity to center is done easily by replacing the second line of code above with:
    noise = 1f - Mathf.Abs(noise * 2f - 1f);
    noise *= noise;
    

    ... which results in noodles that fade out quickly, such that they are strongly defined yet still have soft edges.
  • SirSmokeSirSmoke Join Date: 2013-07-05 Member: 185952Members
    Some more shots... I made the noodles more irregular by doing a multifractal (combine several noise iterations at different frequencies and intensities) on the basic noise and then isolating the midrange. This has a bonus effect of reducing the density of noodles, which lets me have larger areas of solid rock. Hooray for fewer mound clusters! Doing these steps in opposite order would simply produce lots of smooth noodles. I also improved the cliff profile, resulting in wider plateaus and sharp drops without being too square.

    brDgQdK.jpg
    hu5aN0j.jpg
  • HughHugh Cameraman San Francisco, CA Join Date: 2010-04-18 Member: 71444NS2 Developer, NS2 Playtester, Reinforced - Silver, Reinforced - Onos, WC 2013 - Shadow, Subnautica Developer, Pistachionauts
  • NarfwakNarfwak Join Date: 2002-11-02 Member: 5258Members, Super Administrators, Forum Admins, NS1 Playtester, Playtest Lead, Forum Moderators, Constellation, NS2 Playtester, Squad Five Blue, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, Subnautica PT Lead, NS2 Community Developer
    Awesome stuff, man!
  • SteveRockSteveRock Join Date: 2012-10-01 Member: 161215Members, NS2 Developer, Subnautica Developer
    Sweet lava flows! How do you determine when to use the lava texture? Is it based on a height threshold?

    Sure, yeah the fog ain't great right now. I'll try and update that soon (but will be pretty busy next week with GDC and what not).
Sign In or Register to comment.