Volumetric Fog in Unity using Shader Graph (Free Download)

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии • 84

  • @sidremus
    @sidremus 4 года назад +5

    OMG yesssss
    I've been trying to figure something like this out since last summer. I actually began learning HLSL only to hit a massive brick wall..
    you're a godsend!

  • @alexandrepedroza9217
    @alexandrepedroza9217 3 года назад +4

    Great video, super helpful. Only issue so far is the audio which is a bit low.

  • @andreas729
    @andreas729 3 года назад +2

    You are a genius, thank you so much!

    • @AETutsVids
      @AETutsVids  3 года назад

      You are welcome my friend

  • @dillbert1570
    @dillbert1570 3 года назад +1

    absolutely perfect

  • @faiqlaiq6768
    @faiqlaiq6768 4 года назад +1

    Really appreciate man

  • @tricksyhobbitses1695
    @tricksyhobbitses1695 2 года назад

    tex2d cannot implicitly be converted from texture2d to struct unityTextture2d in procedural.hlsl

  • @marcusviniciussilvaoliveir4932
    @marcusviniciussilvaoliveir4932 3 года назад +2

    If you "enter" the fog it disappear, it's normal? With the camera

    • @dj2cano904
      @dj2cano904 3 года назад +2

      I have the same issue

    • @planebreach
      @planebreach 3 года назад

      same ... anyone found a solution ?

  • @zonoscopePictures
    @zonoscopePictures 3 года назад +1

    By any chance would this work in VR? Need some fog in a Quest 2 project I’m developing

    • @AETutsVids
      @AETutsVids  3 года назад

      never tried it, but even if it worked it will affect performance

    • @alejandroendo1245
      @alejandroendo1245 2 года назад

      Did you tried in your Quest 2? I'm in the same situation

  • @CassiusJohnAdams
    @CassiusJohnAdams 4 года назад +3

    I'm curious to know how the performance is on this?

    • @AETutsVids
      @AETutsVids  4 года назад

      The one that uses a texture 3D is pretty good, on a Full HD screen with GTX 1050 Ti the profiler was showing 100 FPS on the GPU

    • @CassiusJohnAdams
      @CassiusJohnAdams 4 года назад

      @@AETutsVids It didn't seem to work for me. I just end up with a mostly-grey plane. Even with the alpha channel for the colour set right down to 0. I can see there's some kind of fog trying to happen, but it seems to block out my scene regardless of what settings I tweak on the texture/shader.

    • @AETutsVids
      @AETutsVids  4 года назад

      Make sure to enable depth and opaque texture in your URP settings

  • @SeanSilas_IronWrath_GTR
    @SeanSilas_IronWrath_GTR 4 года назад +2

    Hello, I am new to Unity and this is my first 3rd party asset. Do you have a tutorial on how to install and is it URP? I bought it out of excitement and thought it would be a easy install. Thank you for making this.

    • @AETutsVids
      @AETutsVids  4 года назад +2

      Hi there, you don't need to install anything just extract the files in a URP project and open the provided scene

    • @SeanSilas_IronWrath_GTR
      @SeanSilas_IronWrath_GTR 4 года назад +2

      @@AETutsVids Oh yes!! I did that and it works awesome! I have an existing project. How can I add it to my old project? and, thank you for the speedy reply!!! :-)

    • @AETutsVids
      @AETutsVids  4 года назад +2

      You should be able to add these files to any project really

    • @SeanSilas_IronWrath_GTR
      @SeanSilas_IronWrath_GTR 4 года назад

      @@AETutsVids ok great. I must be missing something. In my existing project, after I drag the folder volume fog in the asset folder of the project, it is automatically added right?

    • @AETutsVids
      @AETutsVids  4 года назад +2

      Yes, after that you need to do the same as in the provided scene (a plane infront of the camera with fog material on it)

  • @theearthburner6159
    @theearthburner6159 3 года назад

    This is very awesome, but it doesn't show on top of other shaders, I think it must be because of it's layer being below the layer of the other shader but there's no way to change it

    • @AETutsVids
      @AETutsVids  3 года назад

      If you use alpha instead of scene color then it might solve the problem

    • @theearthburner6159
      @theearthburner6159 3 года назад +1

      @@AETutsVids I found a way to do it, thanks anyway. You're doing great work

    • @vd_cuddles4357
      @vd_cuddles4357 2 года назад

      What was the solution? Having the same problem here

    • @theearthburner6159
      @theearthburner6159 2 года назад

      @@vd_cuddles4357 well the solution wasn't ideal, I had to remove the other shaders

    • @vd_cuddles4357
      @vd_cuddles4357 2 года назад +1

      @@theearthburner6159 Ahh right, I think I managed to get it sort of working with my custom shaders by making sure depth texture was on in the forward renderer and changing the number in the material render queue but it tanked the performance too much so I still couldn't use it :/ still cool for what it does though!

  • @katinasjuodukas
    @katinasjuodukas 3 года назад +2

    Absolute game-changing asset..Thank you so much, just that I am a complete noob and even the textures themselves seem to be neon purple so I don't know what to even drag onto that plane :/

    • @AETutsVids
      @AETutsVids  3 года назад

      Purple means shader error, are you using a URP project ?

    • @katinasjuodukas
      @katinasjuodukas 3 года назад +1

      @@AETutsVids Oh right, everything is alright with the URP. Just that as I look through the plane, the resolution of everything seems to drop. Also, is it supposed to have a strict finishing horizon line? I am using it in a night setting however if I lower it down to the bottom of an island, the entire area from the horizon and down is very strictly cut by the color of the fog. The clouds in the video seem to retain the original horizon color. Hard to explain without images but is that supposed to happen?

    • @AETutsVids
      @AETutsVids  3 года назад +2

      For the resolution, I think if you click on URP settings and under opaque texture there is an option for downsampling make it none.
      For the distant end of fog, there is a parameter in the material which defines the distance where it will just be a bland fog and this helps performance, the farther you want to get real fog the more performance intensive it is

    • @AETutsVids
      @AETutsVids  3 года назад +1

      I am not sure if I answered your second point, you can send me screenshots via email

  • @niuage
    @niuage 3 года назад +1

    Does that work with an orthographic camera?

    • @AETutsVids
      @AETutsVids  3 года назад

      Yes you can check the images on the store

  • @trillobit3sIndieGames
    @trillobit3sIndieGames 2 года назад +1

    funciona na padrão? ou somente URP?

  • @seve8138
    @seve8138 2 года назад

    Hi, thank you for your work, it's amazing.
    I see you can fly through the fog in your video but it disappears when I fly through mine.
    Do you know why? I use the V2, Textured and 3D Textured.

    • @AETutsVids
      @AETutsVids  2 года назад +1

      Thanks !
      There are 2 different methods one is the plane in front of the camera and it moves with it (it's child) this one can fly through the fog, the other one is using cubes and they don't allow you to go inside

    • @seve8138
      @seve8138 2 года назад

      @@AETutsVids smart workaround 😄 didn't think it'd be realistic. I'll try it out!

  • @planebreach
    @planebreach 3 года назад

    When you are looking from the outside of the mesh the fog is visible, but from the inside it's not. So when you enter the fog, it disappears ... is this normal ?

    • @AETutsVids
      @AETutsVids  3 года назад

      If you are using the plane fog then yes, but if you are using the one that is a plane child of a camera then that should not be a problem

    • @planebreach
      @planebreach 3 года назад

      @@AETutsVids yea i figured that out. Thx for the tool.

  • @jasonb202020
    @jasonb202020 4 года назад

    thanks for sharing!

  • @darkknightleon9843
    @darkknightleon9843 3 года назад

    Awesome!

  • @darksoldier9503
    @darksoldier9503 4 года назад

    Hi, sorry im very noob with all of this, i try to make the project work but i cant, the plane keeps looking pink and i already enable opaque and depth textures in urp, i really appreciate any help. Thanks!

    • @AETutsVids
      @AETutsVids  4 года назад

      What version of unity and shader graph are you using?
      Is there any errors in the console?

    • @darksoldier9503
      @darksoldier9503 4 года назад

      No console errors, my unity version is 2019.4.17f1 and shadergraph is 7.1.1

    • @darksoldier9503
      @darksoldier9503 4 года назад

      7.3.1*

    • @AETutsVids
      @AETutsVids  4 года назад

      Hmm, the thing is when you see a pink material it usually means that there is an error in the graph or the shader, try to open the graph and save it does that show an error in the console?

    • @darksoldier9503
      @darksoldier9503 4 года назад

      @@AETutsVids Oh god thanks man, i open the shader and save it and now it works. thanks for the help!

  • @azgan123
    @azgan123 4 года назад +2

    Hey man, do you think you can also teach us some VFX graph?

    • @AETutsVids
      @AETutsVids  4 года назад

      That will take some time for me to get in speed, and I am not sure I have much of that TBH

    • @azgan123
      @azgan123 4 года назад +1

      @@AETutsVids Hey boss, just tried your shader and I have problem with getting VFX graph to show particles behind the fog, any idea why? :3

    • @AETutsVids
      @AETutsVids  4 года назад

      I think it is a render queue thing, the plane that has the fog is being rendered before the VFX graph, I am not sure how exactly you can solve this, but you can try to change the render queue value on the material

    • @azgan123
      @azgan123 4 года назад +1

      @@AETutsVids Thanks man, my suspicion exactly. I'll let you know if I figure it out. Btw this shader looks even better in real life. You should put it on asset store.

    • @AETutsVids
      @AETutsVids  4 года назад

      Oh I think any transparent object wouldn't show up in this fog thing cuz the camera texture is rendered before any transparent object.
      I don't think this fog stuff is good enough to be sold as you can see which is why I am giving it for free on itch

  • @bugbystudios
    @bugbystudios 2 года назад +1

    is this optimized for mobile? great tutorial btw.

    • @AETutsVids
      @AETutsVids  2 года назад +1

      No not great on mobile

    • @bugbystudios
      @bugbystudios 2 года назад

      @@AETutsVids thanks for replying. It's still a helpful shader though!!

  • @mdmasudhossain7773
    @mdmasudhossain7773 3 года назад

    I only can see fogs not Cubes :-(

  • @trgamer3193
    @trgamer3193 4 года назад

    Amazing

  • @hereticstanlyhalo6916
    @hereticstanlyhalo6916 3 года назад

    Why can you not see lights when outside the cube?

    • @AETutsVids
      @AETutsVids  3 года назад

      What is the error?

    • @hereticstanlyhalo6916
      @hereticstanlyhalo6916 3 года назад

      @@AETutsVids I have a spotlight, but I want my scene to be foggy, so I have the cube cover the entire scene (its a main menu scene), but because the light is in the cube, I cannot see the light, anyway to fix this, or do I have to have the spotlights outside the cube?

    • @hereticstanlyhalo6916
      @hereticstanlyhalo6916 3 года назад

      @@AETutsVids Also even if the spotlight is outside the fog cube, it doesnt light up any of the fog

    • @AETutsVids
      @AETutsVids  3 года назад

      Not sure what cube you are talking about, but yes this fog doesn't interact with any lights

    • @hereticstanlyhalo6916
      @hereticstanlyhalo6916 3 года назад

      @@AETutsVids Aw rip, and the cube I was talking about is the cube in which the material is attached to

  • @teemobest283
    @teemobest283 4 года назад

    Very thanks!!!

  • @pedrodesanti6266
    @pedrodesanti6266 2 года назад +1

    Nice

  • @namanmunjal3205
    @namanmunjal3205 4 года назад +1

    Great

  • @cacc001
    @cacc001 4 года назад +5

    太厉害了这个效果ヾ(*>∀<*)(ノ∀`●)⊃

  • @marvisgames
    @marvisgames 4 года назад

    i cant download

  • @azgan123
    @azgan123 4 года назад

    Fuck yeah