My Adventure with 3D Perlin Noise

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I was thinking about taurine generation recently I previously thought systems that you find in real games were designed by smart people who actually know what they're doing but the more I look into it the less that seems to be the case in my previous games I made terrain by matching the height to the color of an image which works alright but it's a bit boring I wanted caves and mountains to appear I knew that it had something to do with 3d Portland noise which is just like 2d Perlin noise but well 3d my adventure started when I found a method for generating 3d Perlin noise by combining lower dimensions I didn't really understand it but it was isolated logic I only needed to know how you use it which is pretty straightforward just choose a point and get a value back however I didn't understand how you actually create terrain from it were you supposed to draw a measure on certain regions of it clearly you needed to be an expert in algebra physics calculus and cooking in order to use this effectively but then I had a bit of a revelation from my two detouring that wasn't recreating the noise I was just sampling it picking points that set intervals on the x and y and building a mesh between them what if I just sampled the 3d noise and then put cubes in the space between them setting the transparency to the value returned from the noise or more realistically only creating the cube if the point sampled is above a certain threshold I took about five minutes to write a basic algorithm to do just that and what do you know it did nothing it turns out that if you sample unities Perlin noise with an integer it'll always give you the same value which happened to be just under the threshold which I set to 0.5 so I made a noise scale variable to come at this and then this happened it generated a little ball of cubes and then I turned around and saw this had I done it surely it couldn't have been this easy where was all the complicated math and cooking I tried generating some more but unfortunately it turned into a slide show a quick google search led me to believe that I needed to combine all of these blocks into a giant mesh to improve performance so I did and this happened it turns out meshes can only have 65,536 vertexes vertices for texas a quick little algorithm can handle that I didn't bother to get rid of the mesh faces that were facing the inside since that seemed difficult success I had done it now we get to the fun part I exposed all of the variables i code into the editor for quick changes and made G the update button which resulted in hours of endless fun I also discovered that by ignoring all blocks outside of a certain radius resulted in a planet like structure much cooler than what I had done previously but this is voxel terrain I want to be able to drive a car over it and everyone knows you can't have voxels in a game without being accused of copying minecraft the remainder of the day was spent trying to figure out how to smooth it out I tried drawing lines between adjacent blocks and it looked something like this then moved on to diagonals as well obviously it's a complicated mess I thought I could simplify it by removing blocks that were in the middle but that didn't help much it also introduced a bug where it would sometimes draw lines where they shouldn't be I decided to abandon this approach but downloaded would appear to be working examples but I couldn't figure out how to implement them into my project they all mentioned something called the marching cubes algorithm which is intended to smooth out pixelated graphics or voxel eated if that's word I understand the concept but getting it to work would be difficult the popular game Astra NIR does this well I did some detective work to see if I could uncover some information about their planet generation this reddit post by one of the developers says he was thinking about writing a blog post about this but it's been two years and we still don't have one though in a later tweet he mentions using the marching cubes algorithm which tells me I'm on the right track he also mentions the existence of some free library presumably poly Vox the creators of which also created cubic WA t for unity but now it's taken down for some reason likely because it broke in a later version of unity and that's as far as I got in terms of Astra nears terrain generation I actually found most of this information while writing this script it feels so detective II there's also a $5 asset on the asset store that suggests it can do this with a vague screenshot but it's never mentioned elsewhere just a couple days ago procedurally generated planets were out of my reach but now I know enough to justify looking into it I guess this shows that distractions can sometimes lead us in the right direction productivity breeds more productivity and if I hadn't went down this rabbit hole then I would have spent these few days wondering what would have happened if I had of course for now I'll go back to working on my current project but after I finish it we might get a more interesting sequel to a certain game of mine you
Info
Channel: Nova840
Views: 410,023
Rating: undefined out of 5
Keywords:
Id: TZFv493D7jo
Channel Id: undefined
Length: 4min 28sec (268 seconds)
Published: Mon Feb 26 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.