OpenGL Real-Time Procedural Planet Rendering

  Рет қаралды 162,010

wr00m

wr00m

Күн бұрын

Пікірлер
@DavidNwokoye
@DavidNwokoye 2 жыл бұрын
This is absolutely nuts. I can't believe this is over 10 years old 😱😱😱
@NeilRoy
@NeilRoy 5 жыл бұрын
Wow, VERY nice of you to release the source code! Makes me glad I checked back on this again. I also recently released source code, which can be difficult as we are our own worst critics, but if it can help. I look forward to perusing it.
@MediaFilter
@MediaFilter 12 жыл бұрын
Thanks for the reply. That is the route I began going down today, after posting my question. Far easier to hold in the mind than most projection methods I've seen around. Phil Nowell's approach is essentially nothing more than, "for each surface point, normalize position vector, then multiply by radius", I think. Anyway, best of luck with your worlds.
@fnarmusiccomposition3418
@fnarmusiccomposition3418 3 жыл бұрын
markus persson made a whole planet meanwhile this dude made a whole universe
@Selexo
@Selexo 11 жыл бұрын
I wish Kerbal Space Program had this.. this looks so cool.
@incription
@incription 5 жыл бұрын
... it does
@scavorthespacecowboy2096
@scavorthespacecowboy2096 4 жыл бұрын
@@incription Doesnt ^ Not realtime changes but creating planets is available yes. Someone is working on a procedural universe and it looks awesome. Also this comment was awhile ago, koper is old but not that old
@sknnywhiteman
@sknnywhiteman 12 жыл бұрын
I honestly wouldn't be surprised. Notch has posted links to videos like these in his tweets before, around the beginning of him working on 0x10c. I'm so excited for that game.
@ArcturusArcher
@ArcturusArcher 12 жыл бұрын
Though i could have first waited till the end of the video before blabbering on like this xD. This is so awesome
@42pieguy
@42pieguy 12 жыл бұрын
This is really amazing... something like this taken to the next level of making a game would be totally unique and probably very successful imo.
@ciyttcix6661
@ciyttcix6661 2 жыл бұрын
*ahem* no man’s sky
@onehand77
@onehand77 7 жыл бұрын
Quite an amazing project. I haven't found source code like this anywhere else. Thanks so much for sharing with us!!
@LoganRWeber
@LoganRWeber 12 жыл бұрын
This is the exact type of reply that I was hoping for. Thanks! :)
@Jishaxe
@Jishaxe 12 жыл бұрын
Ah, the development for my game has already started with C++ and OpenGL. The terrain you've produced in this video looks pretty good for my needs, so I'm going to look up the "ridged multifractal algorithm". Thanks :)
@EricFontaineJazz
@EricFontaineJazz 13 жыл бұрын
this is awesome...and entire universe with all the planets procedurally generated...
@MiniWindLab
@MiniWindLab 11 жыл бұрын
this is amazing man ! nice job
@jarblewarble
@jarblewarble 12 жыл бұрын
I have actually created some fractal terrain generators that create infinitely detailed trees using cellular automata - basically, I start out with a 1x1 array, then magnify it to obtain a 2x2 array, and so on. After each magnification, I run the cellular automaton for one iteration, so that new detail is created at every level of magnification. So I've basically created an L-system fractal generator, which could (in theory) be used to create infinitely detailed 2D planets.
@HaoSoft
@HaoSoft 6 жыл бұрын
Dune Soundtrack ! what a brilliant compilation
@markdavison011
@markdavison011 11 жыл бұрын
That is absolutely beautiful
@DxBALLxD
@DxBALLxD 4 жыл бұрын
I love things like this. I simply must learn how to experiment like this on my own
@obidobi2
@obidobi2 12 жыл бұрын
omg the old Dune mod, always liked this one!
@98Zai
@98Zai 11 жыл бұрын
Amazing!! I really love that soundtrack too!
@TotoMacFrame
@TotoMacFrame 11 жыл бұрын
Wow man, that's amazing! Great work!
@zachanima
@zachanima 12 жыл бұрын
An excellent point. So the master seed would handle the generation of planetary positions, which in turn could determine the generation of landscape on those planets. This would allow for various multi-user approaches. I was thinking of something along the lines of Noctis' star guide, where users can catalogue stars and planets for inclusion in the next release of the guide.
@ArcturusArcher
@ArcturusArcher 12 жыл бұрын
Remember the Third Game of Populous? The Beggining? Imagine that concept at some stage with this? 00:15 Missing trees lakes and rivers there. but its impressive... and Imagine so much more to it, like each planetoid had its own gravitational effect to objects and other planets...
@monsieurouxx
@monsieurouxx 12 жыл бұрын
Excellent choice of music :-)
@joshs2475
@joshs2475 8 жыл бұрын
Still better than No Man's sky's procedurally generated planets...
@pandaman-c1i
@pandaman-c1i 8 жыл бұрын
You can blame No Man's Sky for a lot of things, but not planet generation...
@joshs2475
@joshs2475 8 жыл бұрын
Why not?
@pandaman-c1i
@pandaman-c1i 8 жыл бұрын
I'll return the question to illustrate the point, can you show me ONE planet that was badly generated? We are talking about terrain here, landscapes, water and weather. Not life forms or anything else. (My point was that it is pretty hard to implement and for that specific stuff you can't blame No Man's Sky).
@joshs2475
@joshs2475 8 жыл бұрын
François Trudel I can understand that it is probably really hard to program something to be created producerally, but this is unacceptable: i.ytimg.com/vi/nZtEzp9l6B0/maxresdefault.jpg
@pandaman-c1i
@pandaman-c1i 8 жыл бұрын
Indeed it is. Was it underground? It seems to be like when you clip through walls and can't see the walls through the other side. If it is actually a planet and not a group of asteroid or something like that then you're right. There might be a percentage of abberant planets in this case. It is expected though when dealing with procedurally generated stuff as it cannot be tested beforehand (particularly at the scale No Man's Sky did)
@frostcrackle2374
@frostcrackle2374 8 жыл бұрын
Google Maps street view taken to the next level. (I meant that as a compliment; please, don't take it otherwise)
@savkepro191
@savkepro191 8 жыл бұрын
Everything you see is procedurally generated, and the total size of the application is only 0.7 MB. That just blew my mind :O
@SrDomovik
@SrDomovik 11 жыл бұрын
Amazing, I love fractals power
@fidelitycreate
@fidelitycreate 12 жыл бұрын
holy s**t dude that is awesome, I say role on Wing Comannder Privateer 3 or a Star Wars game and land on the Death Star, this really opens a lot of doors for gaming
@MrRobinjam
@MrRobinjam 12 жыл бұрын
Well then... I know what my next project is going to be :D If it turns out half as awesome as this, I'll call it a success.
@LilSnyperX
@LilSnyperX 13 жыл бұрын
I'm interested in your method of storing the planet geometry. The best method I've seen to date is to use six quadtrees in a box shape, is this what you're doing, or similar? I don't like the redundant data at the edges of multiple quadtrees, and a few other things, so I suppose I'm hoping for some even better method I've never thought/heard of just incase! Regardless, this looks amazing, I'm impressed and subscribing just incase you show off anything you do in the future :D
@frijevc
@frijevc 12 жыл бұрын
OpenGL Rocks!
@jarblewarble
@jarblewarble 12 жыл бұрын
This must be the holy grail of game development, or something. :)
@zachanima
@zachanima 12 жыл бұрын
I am happy to see I am not alone in considering 258x258 heightmaps. I've moved vertex heightmap generation to the CPU, as well. glReadPixels is just too slow, even with a 17x17 texture. Yet another question: Your planet is macroscopically decently flat, yet your hills are (locally) fairly steep. When I generate my terrain, I can either have local and global semi-flatness, or local and global steep hills. How did you achieve local steep hills and retain global flatness?
@stickfigure42
@stickfigure42 11 жыл бұрын
And for certain kinds of functions you can directly compute the normal at a given point. Generating it from the higher resolution model is indeed difficult, but generating normal maps from the same function used to generate that model is far easier and also more accurate. (But still quite impressive on this scale.)
@S4ntia60
@S4ntia60 10 жыл бұрын
Wow! Excellent work!
@kogorek1
@kogorek1 9 жыл бұрын
Wow, this looks beautiful. May I have source code of your program for openGL studying purposes? I would be very happy receive one!
@jony1710
@jony1710 12 жыл бұрын
Ahh thanks. I should think that I will be able to print of the slides before and just annotate them in the lecture.
@FredMF
@FredMF 10 жыл бұрын
You have it on GitHub ?
@MrEricGuerin
@MrEricGuerin 13 жыл бұрын
Hi, I am really interesseted by the work you did! Is it possible you help me a little? I wld like to implement the same staff in java, and I would like to know which exact algo (name) you are using for ground generation and do you have nice tutorial that expalin how to manage LOD (I would like to do it in java) but I need minimum the High level algo like in a pseudo code it would be nice. Thanks a lot and really great and impressive job ... and dune song matches really perfeclty here too!
@QuantumAnime
@QuantumAnime 12 жыл бұрын
This was a project for a course at the University of Linköping (Sweden), the course was about using procedural methods for images. He chose to implement it this way. With finity project I assume you mean "Infinity Universe".
@RandalfStudio
@RandalfStudio Жыл бұрын
Это шедевр!
@MrRobinjam
@MrRobinjam 12 жыл бұрын
That's certainly a clever approach, but it occurs to me that if a single "master" seed was used to generate all the planets in the simulation, you could share that seed with other people and they'd be able to generate the exact same universe as you. If you've ever played Minecraft this is probably a familiar concept. This leads to some interesting possibilities - for example, you could make a multi-user simulation where the only initial sync step would be to download the seed.
@HyruleExplorer1992
@HyruleExplorer1992 12 жыл бұрын
Awesome work, the procedural rendering will be the ultimate resource for sandbox galactic games, I think... But I have to ask a question: do you think you can add objects to the terrains using the same technique, and have them rendered procedurally? Like buildings and trees? And what about moving things, like cars and human characters?
@97alien
@97alien 4 жыл бұрын
So this is Spore Alpha?
@zachanima
@zachanima 12 жыл бұрын
Well, I was toying around with libnoise on the CPU, but that would be way too slow even for a 128x128 heightmap + normalmap. I guess it's time to write a ridged multifractal shader :) I take it you perform low-resolution noise for collision on the CPU, and then refine this using textures and normal maps in shaders?
@zachanima
@zachanima 12 жыл бұрын
Well, I would like to retain collision with the terrain, so the vertex height kind of have to somehow get to the CPU. I guess I could just stream this data at a slower pace. Hmm. I would very much appreciate your parameter values - I'm using a fairly simple ridged multifractal algorithm myself, but I cannot have steep hills without having huge, sphere-breaking mountains as well.
@HIMISOCOOL
@HIMISOCOOL 12 жыл бұрын
all of the above in the voxel catagory, casue I'm doing java and C# this year so if I can start learning the maths for this sorta shtuff it'd be a big headstart
@m_mchugh
@m_mchugh 13 жыл бұрын
Very well done!
@toot-thenewgoogle3857
@toot-thenewgoogle3857 11 жыл бұрын
Freakin awesome
@diegocabrera1070
@diegocabrera1070 5 жыл бұрын
Any game in this map would be awesome.
@zachanima
@zachanima 12 жыл бұрын
You may not even need a seed; If you use a hash of the planetoid's absolute position in your simulation, you can feed this as the fourth coordinate to a perlin/simplex noise algorithm - this way, every planet is (almost, depending on your hash function) guaranteed unique, and its position in space is itself the seed required to generate it. I guess you would still have to store the seed for the generation of the positions of planets though, unless you use a similar approach to generate these :)
@AndrewKay
@AndrewKay 12 жыл бұрын
Incredible!
@zachanima
@zachanima 12 жыл бұрын
I figured out how to solve the decrementing size of edges in the normal map - I had to multiply the height factor by some constant left-shifted by the current depth level. However, another issue has surfaced; I use Sobel for generating the normalmap, so the edges of the normalmap don't align properly; the normal map needs data from pixels just outside the 256x256 height map texture to generate a 256x256 normal map. I am considering a 258x258 height map, but that might be a terrible idea?
@Algok17
@Algok17 7 жыл бұрын
It is very cool! Thanks for code)
@MenkoDany
@MenkoDany 11 жыл бұрын
Damn that atmopshere is THICK! Haha good job! :D
@FBHearty
@FBHearty 12 жыл бұрын
Do you realize that's what we're waiting (us, old ppl) since Frontier Elite from David Braben? Add on it, infinite procedural random galaxys, nebulaes, planets and moons. Have you an exe to share, just to dream a little bit? ;)
@jarblewarble
@jarblewarble 12 жыл бұрын
@wr00m Would it be possible to generate infinitely detailed trees on the surface of this infinitely detailed planet?
@stickfigure42
@stickfigure42 11 жыл бұрын
I don't know about that, it has a pretty good dynamic mesh interface. You can process almost a million vertices on a frame to frame basis.
@ruslanmolokin9434
@ruslanmolokin9434 12 жыл бұрын
COOOOL, MAN!!
@kolobokhexopod5423
@kolobokhexopod5423 10 жыл бұрын
Quadtree wrapped on the sphere? How did you do that? You start from cube and recursively divide the sides by quadtree with pushing vertices along the sphere's normals? How with distortion on the nodes corners? Your algorithm support holes in terrain, regions with user defined (not procedural) heightmap? Which bounding volume used for frustum culling of large (far) lod chunks? Can you recommend literature for TNM084?
@SerBallister
@SerBallister 10 жыл бұрын
Distortion doesn't matter as the fractal function is independent of where the polygons are on the surface, you will see polygons looking more sheared as you approach the main cube corners (they have 120deg corners instead of 90, this is what you get for flattening a cube onto a sphere)
@jony1710
@jony1710 12 жыл бұрын
Those allow him to swap out higher level of detail terrain for the lower ones I think. He can calculate the finer detail because the fractal algorithm he is using is scale-able.
@Muhafaka
@Muhafaka 12 жыл бұрын
How much do you think a planet like this would need on the HDD to be saved offline.. or at least something around the Earth's size... 500gb?.. or more then 1TB.. do you know? or have an idea about it?
@chucknov11
@chucknov11 13 жыл бұрын
@wr00m The heightmap is clearly bigger than 192x192.. did you mean 192x192 per quad zone ? I would like to know the total heightmap size for the whole planet.
@garrusvakarian3911
@garrusvakarian3911 12 жыл бұрын
Oh, well in that case this is dinosaur tech! Haha, just kiddin'. Would love to see a space sim utilize this kind of technology.
@NeilRoy
@NeilRoy 9 жыл бұрын
Is there any particular algorithm you used for the terrain generation? It looks quite nice. This is from 2011 I see, I would be curious to see if you done anything more with this. I often thought of doing something similar, only with a procedural city/town generator, with roads, using weights to make it more probable that homes crop up near water, roads etc... I wonder how far one could go with this, perhaps procedural homes where you could enter the inside as well. :)
@hellomynameiskoolaid3829
@hellomynameiskoolaid3829 8 жыл бұрын
+Neil Roy No Mans Sky. Idk if you heard of the video game, worth checking out.
@thepdg5160
@thepdg5160 8 жыл бұрын
Nice to see you here around too! I've seen you actively on Ben's channel as well, that's why. This video still blows one's mind, doesn't it?
@NeilRoy
@NeilRoy 8 жыл бұрын
ThePdg Yuppers! I tend to search for a variety of programming topics online to see what other people are up to, maybe get inspired. Lots of talented folks out there. And yeah, great work in this!
@thepdg5160
@thepdg5160 8 жыл бұрын
I completely agree. It's amazing what people come up with!
@coppertones7093
@coppertones7093 5 жыл бұрын
it looks similar to a musgrave texture from blender, but i’m not sure how to make it with code or what it’s called elsewhere
@TheBreezus
@TheBreezus 7 жыл бұрын
Wow 700KB that is incredible!
@chucknov11
@chucknov11 13 жыл бұрын
I would like to know the dimension of the heightmap.. When i attempt planets like this is always a pain to manage memory space correctly
@KyleOpatik
@KyleOpatik 12 жыл бұрын
Awesome!
@Zenvalley
@Zenvalley 12 жыл бұрын
0x10c is actually free. Only the persistent multiplayer costs monthly. Normal multiplayer will be free also. :)
@LankyLuke97
@LankyLuke97 13 жыл бұрын
Very skilled
@R3VISION3
@R3VISION3 10 жыл бұрын
holy shit this is amazing
@zachanima
@zachanima 12 жыл бұрын
What sort of quadtree level of detail approach are you using? I noticed you mentioned chunk-based, and from the video it seems your chunks are 16 by 16 quadrilaterals. I have been toying around with this approach myself, but anything more than 5 depth levels of pregenerated simplex terrain takes whole minutes to precompute into vertex buffer objects. Generating (and destroying) the depth levels at runtime slows down framerate considerably, as well. I would love to pick your brain on this :D
@stephio76
@stephio76 5 жыл бұрын
Any chance you could share the Unity project variant. Thank you.
@DeMooniC
@DeMooniC 5 жыл бұрын
Is this related to Space Engine? Because its very similar
@stickfigure42
@stickfigure42 11 жыл бұрын
If you're generating height maps, you can just do a derivative operation to the heightmap and BAM: normal maps.
@HIMISOCOOL
@HIMISOCOOL 12 жыл бұрын
one can this be voxelfied? two can this be effectivly networked? 3 can this be networked as voxels?
@LoganRWeber
@LoganRWeber 12 жыл бұрын
I am not, by any means, a master of OpenGL so could somebody tell me this: do the heightmaps of the planets take up a lot of memory?
@HikikomoriDev
@HikikomoriDev 4 жыл бұрын
Please port to Vulkan.
@carlosperche8207
@carlosperche8207 11 жыл бұрын
Please teach me how to do this. Where can I find a tutorial to help me create a spherical planet? I wonder how I can do this. I'm studying OpenGL, Ogre3D. Where beginning to be able to create spherical planets with gravity acting on the bodies? Thank you.
@STRIKEcorperation
@STRIKEcorperation 11 жыл бұрын
Also, KSP isn't randomly generated. All the planets and their paths are carved in stone by the devs. It's not possible to move any planetary body or alter it in any way from within the game. Personally, I think this could be possible if the devs wanted to introduce interstellar flight. The loading time would be extended instead of realtime rendering. It would be very cool, because every one's unique.
@iamtanmay
@iamtanmay 11 жыл бұрын
Please, can you share some examples of your code ? I can generate the terrain, managed to create a distance object of the planet with bump maps, composite materials. But, I am really stumped on the gradual generation as you come closer to the planet, and the gradual disappearance as you move away from it. If you have no future plans for your code, can you share it ? If you are going to commercially use your code, can you at least give an explanation of your development process ?
@KeyAttendant
@KeyAttendant 13 жыл бұрын
@wr00m Wasn't aware of that, thanks.
@AndrewKay
@AndrewKay 12 жыл бұрын
I did read the description, it wasn't there when I read it. Noobs don't know that stuff gets updated?
@zachanima
@zachanima 12 жыл бұрын
I have returned to further pester you for details ... specifically generation of normal maps. I am currently generating a normal map in a shader in tangent space using Sobel. However, when the heightmap texture resolution is increased due to chunk splitting, the normalmap increases in resolution as well, leaving the edge detection outputting smaller and smaller "edges". I think this issue should be circumvented by using an object space normalmap instead, but ... how are you generating that?
@Jishaxe
@Jishaxe 12 жыл бұрын
This is amazing. Great work! I'm planning to implement this strategy in my game some time in the future. Can you lend any tips?
@NimerionTech
@NimerionTech 8 жыл бұрын
This is love.
@TriggerGameStudios
@TriggerGameStudios 11 жыл бұрын
hey i say that procedural planet rendering vid of yours and im working on a game where you can go from grount assualt on foot to space battles with out loading. Do u have the coding for the system? Ill give you full credit in the game for the planet system dont worry. Pleazz Pleazz Pleazzzzzzzzz :) Id love you for it
@zachanima
@zachanima 12 жыл бұрын
The less detailed levels are sometimes split when I split the deeper levels, due to the distance changing. I could try and benchmark how many splits happen at any given time, because I could be doing something wrong there. What is your distance formula for when to split? I'm currently splitting based on the bounding 2D box of the chunk/quadtree branch. How much work did you move to shaders? Perhaps that is a performance issue as well :) Thank you for taking the time to answer these questions!
@chucknov11
@chucknov11 13 жыл бұрын
@wr00m sounds tricky, is there any article i can read about this or ask you few questions on an instant messenger ?
@Fuzzyjug
@Fuzzyjug 12 жыл бұрын
Okay very well... Let's take up *Frontier Elite* now!!!!!
@zachanima
@zachanima 12 жыл бұрын
Very interesting. This makes sense, as well. By object-space normal maps, you mean each chunk has its own normal- (and height-)map? If this is indeed the case, I'd like to ask (if I may be so bold) what resolution height/normalmap you use per chunk? Furthermore, what approach are you using to generate noise fast enough for a higher-resolution heightmap/normalmap than the chunk vertex noise? Thanks!
@chucknov11
@chucknov11 13 жыл бұрын
@wr00m nice, so as soon as you get into a greater level of detail for a quad you generate the heightmap for that quad on the fly ? What happen when you zoom out, do you unload it out of memory or cache it somewhere ? If you have some link for me i would appreciate. Seeing how fast you zoom in I really dont see how i would manage to generate so many heightmap data in so few time and calculate the average normal for each vertex and everything... Seems a bit complex to optimize here.
@idirbelaid2837
@idirbelaid2837 3 жыл бұрын
can you share the file again please, it seems the link is dead !! thank you in advance. great work, and thank you for your kindness.
@ObscureArcanist
@ObscureArcanist 12 жыл бұрын
Awesome Job!! Now save the planet to a file....
@SuperMegaLoser
@SuperMegaLoser 13 жыл бұрын
great music, somehow reminds me of games done by psygnosis.
@Ivyncode
@Ivyncode 12 жыл бұрын
Does anyone know if spore uses perlin noise to handle its planet generation/terraforming?
@jony1710
@jony1710 12 жыл бұрын
Quick question. Can you manage without a laptop while doing a computer science degree? I want to get a desktop computer with much superior specs but I am not sure if I will need a laptop in lectures and stuff. :)
@MediaFilter
@MediaFilter 12 жыл бұрын
@wr00m Very cool work. Are you able to tell me what approach you use to seamlessly map quads to the surface of the sphere? I can see you are using quadtrees for the surface subdivision, but ignoring that, I guess that at some level you have a direct mapping between a uniform grid and the sphere surface? It's something I've been wanting to do for a while.
@matejhudak4260
@matejhudak4260 9 жыл бұрын
Beautiful. Can I make music and 3D graphics for your game? Will it be online? MMO?
@ShadowofCatron
@ShadowofCatron 12 жыл бұрын
Wow. This is very interesting. Do you know of any resources to learn more about this type of procedural generation?
How does procedural generation work? | Bitwise
13:48
DigiDigger
Рет қаралды 394 М.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
The Best Add-on for Photoreal Lens Simulation in Blender?
36:37
Gleb Alexandrov
Рет қаралды 29 М.
The Math Behind Speeding: More is Less
8:50
The Scribbled Equation
Рет қаралды 207 М.
Java - Procedural Planet Rendering Demo
4:29
concerned patient
Рет қаралды 9 М.
Real-Time Rendering of Procedurally Generated Planets
4:16
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 157 М.
I Scraped the Entire Steam Catalog, Here’s the Data
11:29
Newbie Indie Game Dev
Рет қаралды 597 М.
Reinventing Minecraft world generation by Henrik Kniberg
49:41
Coding Adventure: Procedural Moons and Planets
22:48
Sebastian Lague
Рет қаралды 1,8 МЛН
How Games Fake Water
22:52
Acerola
Рет қаралды 227 М.
Meshless Real-time Ray Tracing Demo
7:17
ARodgers
Рет қаралды 129 М.