Atmospheric Scattering (and also just faking it)

Ғылым және технология

Follow me on:
Twitter: / iced_coffee_dev
Github: github.com/simondevyoutube/
This project tackles adding atmospheric scattering to our procedural worlds, using both a physically accurate model and a hacked together pile of garbage approach. Depending on your use case, if you need photo realism or a more exaggerated look for your 3d world generation, one or the other may suit you.
This is the 6th in a series of 3D world generation tutorials. In the previous tutorial we covered some texturing technique, and in this project we'll build on that and improve it with an atmosphere to help with the overall look.
Just treat this as a jumping off point for your own projects, there's lots of ways to do this, but if you want to understand how some of the bigger engines do it, or how to cobble together some shaders on your own, this can help. Especially if you're doing a lot of procedural generation for yourself.
Full source code for the project is available, so if you're interested in fiddling with the code, screwing around with it, or improving it.

Пікірлер: 41

  • @stephio76
    @stephio764 жыл бұрын

    I would pay and I think many would, if this would be implemented in Unity or UE4! Amazing work!!

  • @simondev758

    @simondev758

    4 жыл бұрын

    Sure, is Unity ok?

  • @stephio76

    @stephio76

    4 жыл бұрын

    @@simondev758 YES!!!!!! Thank you!

  • @SimonProductionsTM
    @SimonProductionsTM Жыл бұрын

    What a wonderful name

  • @AddyVDH
    @AddyVDH4 жыл бұрын

    Hey! This is awesome. By the way, there is a vs-code plugin which lints glsl code which is stored in js strings. I can find it for you if need be.

  • @simondev758

    @simondev758

    4 жыл бұрын

    Really? That's awesome, going to go find it, thanks for the tip!

  • @AddyVDH

    @AddyVDH

    4 жыл бұрын

    @@simondev758 Found it: marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal (If this isn't working I can check my setup to see what I am using)

  • @ChrisTharpArt
    @ChrisTharpArt4 жыл бұрын

    Best one yet. Was just playing with the unity hdrp. That does this on a more local level. Would love to build planets.

  • @simondev758

    @simondev758

    4 жыл бұрын

    I really gotta start playing with Unity, any recommendations where to start?

  • @ChrisTharpArt

    @ChrisTharpArt

    4 жыл бұрын

    @@simondev758 I have a pretty good starter vid in "getting to know unity" on my channel. Pretty much for if you know nothing about the program also Brackeys would be a great channel if you haven't checked them out.

  • @Nakasasama

    @Nakasasama

    4 жыл бұрын

    @@simondev758 brackeys tutorials.

  • @ScottyAnderson
    @ScottyAnderson3 жыл бұрын

    Hey SimonDev, really interesting video, did you manage to implement this into something like Unity? If so where could I find this? I tried your github but could not find anything, cheers in advance.

  • @simondev758

    @simondev758

    3 жыл бұрын

    You could port it to Unity, there's nothing JS specific here. It's all in github, under ProceduralTerrain_PartX for whichever video.

  • @ScottyAnderson

    @ScottyAnderson

    3 жыл бұрын

    @@simondev758 Thanks for the reply, ill give it a shot, if I did manage to get this into unity, how would I go about giving the atmosphere a custom colour prehaps? (The first version you showed, the physically simulated atmosphere). github.com/simondevyoutube/ProceduralTerrain_Part10/blob/main/src/scattering-shader.js (Is this the shader?), would I just translate this into unity's shaderlab code I am guessing and apply the shader to a material? Many thanks

  • @danielgrizzlus3950
    @danielgrizzlus39509 ай бұрын

    You didn't explain what mesh you apply the shader to and how

  • @diviik6619
    @diviik66192 жыл бұрын

    Great work Simon, as always. I'm having a hard time trying to implement the scattering in a small project just for fun. Your custom shader works really good, but when I switch to the _ComputeScattering function, the effect is only visible when you are really close to the planet. I'm trying to figure this out, but I wonder if you encountered the same problem. Cheers!

  • @simondev758

    @simondev758

    2 жыл бұрын

    Might be an issue of scale, that scattering is meant for actual earth sized distances.

  • @Emivoita

    @Emivoita

    9 ай бұрын

    ​@@simondev758 I was trying to implement this is unity. I believe the problem is that you have the primary ray starting at the camera position rather than the edge of the atmosphere. So rather than setting the primaryStepPosition to 0, set it to the first ray intersection point with the atmosphere.

  • @jaulloa21
    @jaulloa217 ай бұрын

    Can you use this scattering method on a plane terrain

  • @Mrspritneybeers
    @Mrspritneybeers2 жыл бұрын

    Awesome video! Is there a way to do this with unity shader graph?

  • @simondev758

    @simondev758

    2 жыл бұрын

    I'm not at all familiar with Unity's shader graph, sorry.

  • @genjivibes2264
    @genjivibes22642 жыл бұрын

    this isnt a tutorial you didnt show how to do it like atall you just pulled up a bunch of complex code highlighted abit of it was was like here lmao basically a presentation of your working and showing a hint of how you did it

  • @simondev758

    @simondev758

    2 жыл бұрын

    Depends what you define a tutorial as. Sounds like you want me to step through every line, which is fair but not what I do. I'm used to showing the process, the ideas, and leave the implementation to other people.

  • @larperdixon723
    @larperdixon7237 ай бұрын

    Has the source code been taken down? I don’t see it on your github.

  • @Nakasasama
    @Nakasasama4 жыл бұрын

    More more more

  • @simondev758

    @simondev758

    4 жыл бұрын

    Can do! Any suggestions?

  • @Nakasasama

    @Nakasasama

    4 жыл бұрын

    @@simondev758 cave system on procedural planet you have been designing. Similar system that no man's sky has. Pretty pretty please with whipped cream and a cherry on top.

  • @creeperboommcsdatapacks1561
    @creeperboommcsdatapacks15613 жыл бұрын

    Where is the Code?

  • @simondev758

    @simondev758

    3 жыл бұрын

    Github

  • @creeperboommcsdatapacks1561

    @creeperboommcsdatapacks1561

    3 жыл бұрын

    @@simondev758 Ok thanks but how is it called in the repositories?

  • @Grytix5567
    @Grytix556710 ай бұрын

    i want to know how to do this in roblox

  • @Nakasasama
    @Nakasasama4 жыл бұрын

    What no love it?

  • @simondev758

    @simondev758

    4 жыл бұрын

    Sorry, what?

  • @Nakasasama

    @Nakasasama

    4 жыл бұрын

    @@simondev758 I didn't like it i loved it. Unfortunately, only have the like option. This is something I was curious about making atmospheric effects.

Келесі