I Made Sebastian Lague's Procedural Planet In Godot 4

Поділитися
Вставка
  • Опубліковано 17 лис 2024

КОМЕНТАРІ • 104

  • @athillion
    @athillion  2 роки тому +83

    Hi! What do you think about custom post-processing in Godot? What was your experience? Also, have you tried compute shaders with Godot 4 yet?

    • @asdasfdfgewqgrgyjh
      @asdasfdfgewqgrgyjh Рік тому +8

      Glad they finally added compute shaders.
      I remember having a long conversation about that on the Godot Github a couple years back but it was decided not feasible due to the OpenGL 2.0 support and we would have to wait for the Vulkan renderer

    • @serendipinator
      @serendipinator Рік тому +12

      Can you make an issue for this with your current struggles and project as an example of why mult-pass post processing is needed. The Godot Core Contributors are fantastic but tend not to add a feature unless there is a documented use case for it. This seems like a perfect candidate

    • @saminegamme
      @saminegamme 11 місяців тому

      how can i do that in shader
      or gdscript

    • @davidzaydullin
      @davidzaydullin 8 місяців тому

      thing i dont like about it is that i cant have some variable for objects that i can read while post processing

  • @forthfora
    @forthfora 2 роки тому +102

    Great work!! I always wanted a Sebastian Lague-like video on Godot, you nailed it!!

  • @mikenone5902
    @mikenone5902 8 місяців тому +1

    I'd just like to say you did an excellent job both on the project and in making the video. It's very well articulated from start to finish. Very thorough!

  • @Chevifier
    @Chevifier 2 роки тому +60

    Me: "Im getting good and comfortable making fragment/vertex Shaders"
    Compute Shaders: "Well Hello There!"😂

  • @TommyLikeTom
    @TommyLikeTom Рік тому +11

    I love Sebastian Lague. Great job! I noticed you also implemented his style and tone in your video project

  • @HZ_Sai
    @HZ_Sai 25 днів тому +1

    this is beautiful. i really feel like i want to understand this . i love nature i think about it all the time and i think understanding this will make me enjoy thinking about it even more . thanks .

  • @jimmio3727
    @jimmio3727 Рік тому +5

    My experience with viewports in 3.x was "don't use them ever" as they're quite fiddly to setup and then also extremely slow. I see that hasn't changed much.
    In my case, I was creating a ray-sphere intersection atmosphere similar to yours, however I didn't care that it wasn't true volumetric; I just wanted the sky to look good in a first person shooter project I was working on. So what I did was adapt the original viewport version to fit on a hemisphere and then to draw the hemisphere first (render order used to be set by tree location; now that's further adjustable in 4.0 on top of the usual node order) and force each fragment to be max. depth. This worked great and brought my performance up immensely; but obviously it's not without issues and isn't a fullscreen effect at that point.
    Happy to see it's not just me, at least...

  • @natcracken
    @natcracken Рік тому +2

    I'm been trying to hack together deferred rending in Godot, and the multi-pass requirements for it are very simmilar to your project. I'm dissapointed that Godot still isn't up to the task, and thank you for trying it first. You've saved me a lot of time

  • @billyfromzera4162
    @billyfromzera4162 2 роки тому +11

    I love how you explain it!

  • @ZylannMP3
    @ZylannMP3 2 роки тому +45

    In my project, I use a full-screen quad for planet atmospheres and lens flares. The atmosphere is a simple ray-sphere integration, but maybe it could include scattering to be more fancy (curious about baking optical depth! I might poke at your code some day). I don't use any viewport. When I get far enough from a planet, I switch the fullscreen quad to a cube around the planet, which is done seamlessly. It allows to layer multiple planets on screen, while reducing the amount of pixels to process in fragment shaders, resulting is better performance. I haven't tackled oceans though, which might be tricky. For oceans I was thinking of actual geometry (a sphere that tessellates when getting close) which would use depth too, so it would not be bothered by the other post-processing effects and would be able to wave, although I'm not sure about the effects of overdraw and transparency. In the distance it could eventually collapse into the ground shader to prevent Z-fighting, since my project takes place with large distances. It would be great if Godot allowed more interop between compute shaders and the main renderer. And also provide more APIs to do postprocessing effects as well, though I'm a bit concerned that my trick switching to cubes would not apply there...
    Check ua-cam.com/video/Cq_dHmgcc7U/v-deo.html

    • @athillion
      @athillion  2 роки тому +7

      This is probably a better approach than multiple viewports, I was also considering using actual geometry for the ocean, since I wanted to add actual waves to it. I stuck with the full-screen quad for now because I wanted the project to reflect Sebastian Lague's as much as possible so I could make a more valid comparison. If Godot could get better support for custom post processing, that would be amazing! Your solar system demo looks amazing. I suppose your voxel engine is not available on GitHub? I am looking into implementing something similar using Dual Contouring.

    • @ZylannMP3
      @ZylannMP3 2 роки тому +2

      @@athillion (not sure what's going on with UA-cam, I attempted to answer 3 times already but each time the comment goes away in limbo Oo)

    • @ZylannMP3
      @ZylannMP3 2 роки тому +9

      6th attempt....... my voxel engine and the demo project are both available on my Github. Sorry no links in this comment, I feel like UA-cam has an auto-mod which deletes comments way too aggressively or something

    • @Sk4lli
      @Sk4lli Рік тому +1

      @@ZylannMP3 Yeah, for some reason often comments with links are aggressively deleted. Even links to other UA-cam videos.
      But it's an interesting approach. How does ist compare performance wise?

    • @ZylannMP3
      @ZylannMP3 Рік тому +5

      @@Sk4lli I haven't tried the demo from this video yet so I don't know about comparison, but my project can run at 60fps on my 1060. I should probably try uncapping framerate to see how high it goes, but I not only have atmosphere in my project, also got lens flares and a multiple voxel-based planets with scattered rock props^^ I actually have an ocean on one of them, but it's just a big sphere. And later I want to add more fancy water, impostor foliage and planetary rings. And player-made structures such as buildings and ships, but that's way later in the future xD

  • @shubhamjawale8900
    @shubhamjawale8900 3 місяці тому

    You inspired me bro!! I have been following Sebastian for a long time but you gave me hope again nice work...

  • @stayathomedev
    @stayathomedev 2 роки тому +6

    Awesome job! Been wanting to do this myself.

  • @dunyakilavuz
    @dunyakilavuz Рік тому +2

    Always happy to see works like this made in Godot, keep up the good work!

  • @HypeLozerInc
    @HypeLozerInc 2 роки тому +1

    Thank you, this is what I've been curious about love seeing experimenting with engines

  • @NiklasAndersson7
    @NiklasAndersson7 Рік тому

    Very interesting material. Many thanks for all your work and this valuable contribution to the Godot community!

  • @Shack263
    @Shack263 2 роки тому +3

    This is incredible! Good work. I hope one day I can make stuff like this too.

  • @BastiaanOlij
    @BastiaanOlij Рік тому +3

    I'll have to take a closer look at your project but I'm pretty sure you can create the ocean and atmosphere effects without resorting to postprocessing the way you are doing this, instead rendering a sphere around the planet and embedding the logic there should result in the same effect.
    Also you can likely combine your ocean and atmosphere pass into one. Both work on the same dataset, if the height you're sampling is below ocean depth you perform the ocean logic to get your base color, else just take the color as is. then apply atmosphere on top.

    • @GonziHere
      @GonziHere Рік тому

      I feel like you are correct, but bunching several post processes into one isn't a correct solution, rather a workaround for Godot, IMO.
      If it's a valid technique (IMO, it is) and can be done straight-forwardly without an engine (IMO, it can), it's an issue that Godot cannot do it, no?

    • @dfunited1
      @dfunited1 Місяць тому

      I don't think that would be in the spirit of the original Sebastian Lague project that he's recreating.

  • @kallelfiori9767
    @kallelfiori9767 Рік тому

    this have a Sebastian Lague vibe but in Godot, love it

  • @theotherquou
    @theotherquou Рік тому +1

    Beautiful project and beautifully put together video :)

  • @owenlloyd2528
    @owenlloyd2528 Рік тому +1

    Thank you. This was very interesting!

  • @zacharychristy8928
    @zacharychristy8928 Рік тому +5

    I've worked with some CUDA in the past, and there's a LOT of similar concepts between CUDA kernels and compute shaders. Im really excited, there's a ton of cool things you can do with that kind of power that you can't do with fragment/vertex shaders. You showed that off really well!
    Man, it sucks that they haven't added multipass shaders. I really wanted those.

  • @LaSandWitch
    @LaSandWitch Рік тому +3

    Quality, informative, thorough video! Loved it! Very Sebastian-esque, but definitely doesn't feel like a copy cat or anything!

  • @99JasonKim
    @99JasonKim 2 роки тому +3

    impressive

  • @wojciechbem8661
    @wojciechbem8661 2 роки тому +3

    Very inspiring. Keep going 💪

  • @Mark_Rober
    @Mark_Rober Рік тому

    This is amazing!

  • @addmix
    @addmix Рік тому +1

    I was planning on doing this eventually, but it looks like you've beat me to it.

  • @Sk4lli
    @Sk4lli Рік тому

    Very nice and informative video! I really hope these gaps in Godot capabilities get fixed, then it would definitely become a more powerful engine.

  • @saibadam
    @saibadam Рік тому

    Me: Learning how to move a cube.
    Athillion: Compute shaders

  • @stanleesiele6028
    @stanleesiele6028 6 місяців тому

    If only people would make videos this way

  • @Steveplays28
    @Steveplays28 Рік тому +1

    Great work, looks phenomenal!

  • @johanngambolputty5351
    @johanngambolputty5351 2 роки тому +7

    Bravo! I have been meaning to do this for his slime sim, but have been looking for a way to use OpenCL since I know a bit of that. I might just end up using godots python binding so I can use pyopencl to set up my buffers and launch my opencl kernels... I like OpenCL because its practically just plain C without too much extra syntax.

    • @astroid-ws4py
      @astroid-ws4py 2 роки тому +1

      Just asking, How portable is OpenCL between systems? Is it possible to ship a game that includes OpenCL code for Linux, Windows and Mac easily? How does the OpenCL dependencies get installed? Asking for general information not necessarily that it is the best way to go for making with it games. Thanks.

    • @johanngambolputty5351
      @johanngambolputty5351 2 роки тому +1

      @@astroid-ws4py In theory, the code you write should work with every vendor that has implemented the OpenCL specification, but a bunch of stuff is implemented as extensions I think. For instance, I mostly use it on my AMD card and when I went to run my code on my laptop with intel hd graphics, it turns out that it only has floats and no double types (if you don't necessarily need the precision, you can just swap with a typedef). Though I think that's just an integrated graphics thing, most modern GPUs should have doubles.
      The OpenCL deps usually need an extra driver like CUDA for NVIDIA or ROCm for AMD (separate from the graphics driver), which the user needs to install. I've only really tried on Linux and only really on manjaro and arch, where there is a opencl-amd AUR package, which is a one click install. It really depends on how easy it is to get users to do so.
      After that, if you're working in C/C++, as long as the driver is installed and your program can find the so/dll, none of the code should be platform specific, so it should all work. This shouldn't be too different for a wrapper in another language like pyopencl, but it needs to also know where the .icd file for the driver is, so this might add some extra steps. Also, the user might need to also install python in that case, unless it can be bundled with your project (I imagine Godot does this, but I haven't looked).
      TLDR: Code itself should be almost 100% portable, cpu-side only the OpenCL header location import changes and only for Mac (and once its compiled this won't matter for the user...) and gpu-side, well it should be fine if you're writing pretty plain code with no fancy extensions. Dependency-wise, one driver is needed.

  • @emoneydev8684
    @emoneydev8684 2 роки тому +3

    Amazing 👏👏👏

  • @ZZKJ396
    @ZZKJ396 Рік тому +1

    Really well explained, subbed! 👍

  • @Chevifier
    @Chevifier 2 роки тому +2

    Instead of trying to write to the screen texture you could use a copy of it make the changes then use quad mesh and scale it up to the camera View matrix then apply that texture to it. Ive never actually attempted it but ive seen multiple screen space shaders do it. cell shading for example or you could even use a texturerect Control node set to full screen. For the MeshInstance version just add this to the shader. To line it up with the camera
    void vertex(){
    POSITION = vec4(VERTEX*scale_multiplier,1.0);
    }

    • @athillion
      @athillion  2 роки тому +3

      This seems quite similar to how I am doing it already. I take the viewport texture from the source camera and provide it to the next step, which is connected to another viewport, which produces a new viewport texture. 🙂 The shaded texture is slapped on each corresponding billboard quad mesh.

  • @rrtt_2323
    @rrtt_2323 Рік тому

    Very inspiring. I wanted to try that before.

  • @UberSpaceCow
    @UberSpaceCow Рік тому

    Wow! What an awesome video. Thanks for this :)

  •  2 роки тому +9

    Man nice video, you accomplished what I am trying to do for my game. Do you mind if i look to your code and probably use some? Also i wonder. What game are you developing?

    • @athillion
      @athillion  2 роки тому +9

      Sure! The code is free to use 🙂 I am working on something similar to a colony / life sim, maybe a hybrid between Spore and No Man's Sky, but smaller scale.

  • @Darkest-Kn1ght
    @Darkest-Kn1ght Рік тому

    I thoroughly enjoyed this video Athillion! Thank you, Thank you, and Thank You!!! I watched Sebastian Lague's series on the delivery game he created and was excited to see him using "real world" data to create a virtual version of Earth to fly around. My question is... could this be done in Godot, to the point where player characters could be placed in specific locations to explore and travel through? These characters would be land based at first and have no ability to fly around until later versions of the game. I have a concept for several games that I could implement, and one of those games would be based around a futuristic version of Earth gone terribly wrong, as well as other planet exploration due to having to leave Earth because of what happened.

  • @SnowyFoxFox
    @SnowyFoxFox Рік тому

    I'm sitll fairly new to gamedev, and I don't know much about shaders and post-processing, but I do know that Godot 4 is still in its infancy, as are many of its features. Godot doesn't have a very large team working on it, and they can only focus on so many things at once... so, especially when it comes to advanced visual effects and optimisation, it's going to be playing catch-up to Unity and Unreal for some time. Its real strengths lie in its workflow and its open source nature.

  • @RedDread_
    @RedDread_ 2 роки тому +5

    Great work.... Mind if I use this to create a Kerbal Space program clone?

  • @cholasimmons
    @cholasimmons 9 місяців тому

    Sebastian is King!
    I could do with that starfield in the back, is that procedural?

  • @B_dev
    @B_dev Рік тому

    that's cool! i tried to do this about a year and a half ago, I got the planets generating mostly OK but didn't get into the shaders. I also never got to implement an LOD to allow for surface exploration, not to mention colliders.

  • @Galomortalbr
    @Galomortalbr 25 днів тому

    I would merge all the shaders together, not pretty solution, but it works if it works

  • @RENhoekLOUD
    @RENhoekLOUD Рік тому +1

    cuando llega Godot 4 Stable/Oficial (no Beta)? y si habra problemas con inportar proyectos de las verciones 3?

  • @pedroforesterdasilva
    @pedroforesterdasilva 4 місяці тому

    Incredible!

  • @RobertoMaurizzi
    @RobertoMaurizzi 2 роки тому

    Interesting video and very good exposition of the process and problems!
    I don't use Godot (I decided it'd be more useful to learn Rust while trying to write games, so I started with Bevy) but I'd really like to see more videos like this!

    • @RobertoMaurizzi
      @RobertoMaurizzi 2 роки тому

      Hmmm, with Beta 6 I'm getting a `SHADER ERROR: Tokenizer: Unknown character #35: '#'` on the line `#include "res://materials/shaders/include/Math.gdshaderinc"` of a shader that should be the Ocean one (has a uniform float OceanRadius - and no, there's no shader resource name anywhere I can see... 🤔)

  • @theneonbop
    @theneonbop Рік тому

    Good video! I think the stars look too bright, in real life they are actually very dim but your eyes adjust to the dark to make them brighter. The absence of this in the game makes the transition from day to night look a bit unrealistic.

  • @__yunusey
    @__yunusey 11 місяців тому

    Great content!

  • @luisernestodeltoropena6606
    @luisernestodeltoropena6606 Рік тому

    Really amazing, congrats! Can you give me some tips about where and how to learn more about computer graphics, to get to that level?

  • @KillahMate
    @KillahMate Рік тому +2

    Godot's current postprocessing setup is really basic, and the developers are aware of this - there's already an open Github feature request, and something much more flexible and more performant is expected to be added somewhere down the line... but not any time soon unfortunately. Hopfully sometime in Godot 4.x.

  • @NeilRoy
    @NeilRoy Рік тому

    Very nicely done.

  • @kaihenthe
    @kaihenthe Рік тому

    good video, could help alot with my prototype.

  • @grilleFire
    @grilleFire Рік тому

    Any chance in making phsycis gravity and collisions ?

  • @user-es6wn6pz3e
    @user-es6wn6pz3e 19 днів тому

    I'm not sure if I completely understand why you had to use multiple cameras, as I'm not too familiar with godot, but do you need to run those shaders as post-processing effects like you did in unity? Couldn't you just put a slightly oversized sphere around the planet, and run water and atmosphere as a frag shader on that? Or, to also have it work when inside, just put like a small quad right in front of the camera, and run the shaders as frag shaders on that?

  • @SeleDreams
    @SeleDreams 2 роки тому

    the compute shaders don't use the shader language of godot ? since i remembered godot having a gdscript-like shading language that gets compiled to glsl rather than directly writing the raw glsl

  • @alexanderstreng4265
    @alexanderstreng4265 Рік тому

    Godot 4 has sky shaders. Maybe you could convert your stars to it. Is it necessary to have fxaa as a viewport or csn you get away with just enabling fxaa in ProjectSettings.

  • @yefersonramirez9585
    @yefersonramirez9585 Рік тому

    Hiii, I donn't know if somebody have tried enable antialiasing and noted that effect dissapear. Somebody has idea what part of the effect can be affected by this? I would appreciate all possible help :)

  • @ilyad4288
    @ilyad4288 Рік тому +1

    It reminds me of Spore

  • @zzmz1670
    @zzmz1670 Рік тому

    awesome!

  • @marc.lepage
    @marc.lepage Рік тому

    Nice!

  • @oracuda
    @oracuda Рік тому

    what is the unity project's performance without post processing compared to godot's?

  • @kaileh57
    @kaileh57 2 роки тому +2

    what beta of godot 4 did you use for this?
    (also great vid)

    • @athillion
      @athillion  2 роки тому +3

      Thanks! I used beta 3, then 4, then 5 🙂

  • @TriviaQuizocity
    @TriviaQuizocity 5 місяців тому

    Bro did everything in the most difficult way you could😂

  • @maniksharma9736
    @maniksharma9736 Рік тому

    Can u create a motion blur shader ?

  • @neozoid7009
    @neozoid7009 Рік тому

    Awesome

  • @haybail7618
    @haybail7618 2 роки тому

    this video is very sebastian-like

  • @GoatedDeveloper
    @GoatedDeveloper 9 місяців тому +2

    I'm going to try this in the roblox game engine wish me luck

  • @tawandagamedevs
    @tawandagamedevs Рік тому

    Why is your local thread count 512 its suppose to be between 0-31

  • @and-there-it-goes
    @and-there-it-goes 2 місяці тому

    thx

  • @ptkstefano
    @ptkstefano Рік тому

    I'm getting to the point where I'm comfortable with my knowledge in web development, but most of the stuff you've shown flies totally over my head. I wonder if I'll ever get to a point were I can understand this.

  • @vediamocosa2876
    @vediamocosa2876 Рік тому

    Is there will be a videogame?

  • @HZ_Sai
    @HZ_Sai 25 днів тому

    it's been already a year for me learning godot and am still stupid as f* . i can make character controllers and inventory and levels and stuff but goddamnit i still feel like i haven't learned anything

  • @feedmind4669
    @feedmind4669 2 роки тому +1

    subd

  • @markcorrigan3930
    @markcorrigan3930 Рік тому

    So when Daggerfall godot??? 😃

  • @1piece-nftmarket
    @1piece-nftmarket 6 місяців тому

    i cant even work on shaders from sabestian league.

  • @hiperfx892
    @hiperfx892 6 місяців тому

    Finally! Sebastian from Walmart 😂

  • @reddragon_2002
    @reddragon_2002 Рік тому

    Как сделать космос в Godot? Сделай видео)

  • @JakubSK
    @JakubSK 5 місяців тому

    I made this in a much easier way in Godot and it runs at 60fps.

  • @scififan698
    @scififan698 Рік тому

    you even learned to talk a bit like Sebastian Lague. lol

  • @carroteish3289
    @carroteish3289 Рік тому

    Svensk?

  • @gibarel
    @gibarel Рік тому

    doesnt godot 4 support vulkan? why use opengl then?

  • @mattlegge8538
    @mattlegge8538 Рік тому +6

    I bet you're not wanting to go back to Unity now..

  • @themax2go
    @themax2go Рік тому

    can't run, i get a number of errors:
    "@export_node_path isn't a constant expression" (@export_node_path(Camera3D) var camera_path)
    E 0:00:09:0348 SCREEN_TEXTURE has been removed in favor of using hint_screen_texture with a uniform.
    FXAA.tscn::1:410
    E 0:00:09:0348 set_code: Shader compilation failed.
    Condition "err != OK" is true.
    servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp:2059 @ set_code()
    E 0:00:09:0758 version_get_shader: Condition "!version" is true. Returning: RID()
    ./servers/rendering/renderer_rd/shader_rd.h:140 @ version_get_shader()
    system: M1 MacOS

  • @lazi21
    @lazi21 2 роки тому +1

    snake_case