3:47 slight error, exponential squared fog doesn’t actually reach zero, it just approaches zero faster than non-squared exponential fog.
@KingBobXVI
2 жыл бұрын
The animations on the cardboard cutout were absolutely top-notch, lol.
@spore124
2 жыл бұрын
Math sticklers will point out that neither the exponential nor exponential square methods actually reach zero. They approach zero at different rates which, for the case of rounding from floating point numbers, allows the squared function to reach the smallest possible value much more rapidly. The exponential version will also eventually reach that point. Mathematically they're both forever above zero though. From these methods, only linear actually makes it.
@Cyberfishofant
2 жыл бұрын
you are probably right, but you could just define a very small cutoff
@LtPulsar
Жыл бұрын
@@Cyberfishofant The mathematician in me says that step functions are for cowards. The physicist in me says things like "the Dirac delta function is the derivative of the Heaviside step function".
@immortaldev1489
5 ай бұрын
if (fogFactor < 0.00000000001f) {fogFactor = 0.0f;}
@obanxMolly1991
2 жыл бұрын
Just found this bc I couldnt figure out how to implement some decent looking fog- Really love your video/editing style, have my sub. Also: Nice choice of music, I see you are a man of culture
@Acerola_t
2 жыл бұрын
Thanks so much!
@xanderlinhares
10 ай бұрын
After learning about what gets drawn to the camera depth texture problem you describe, I thought “why not just get access to the actual depth buffer”. Serious rabbit hole but it turns out that it is possible. You just have to set the render target data with your own buffers (and maybe blit a copy before it gets cleared). That should give you access to your grass depth.
@Acerola_t
10 ай бұрын
Yeah I figured this out about a year later it was nearly impossible to figure out how to properly generate your own depth tex with Unity's API since no one has ever asked the question and whoever does never gets a response lol But yes you're right! It's possible and it's pretty great.
@MarcosPS8
2 жыл бұрын
Greetings Acerola! I'm game artist and I wanted to let you know that I really find so so interesting your videos. They are totally amazing and helped me understand some mistakes I've been seeing during my career. I just wanted to ask you if you plan to make soon more complex videos about art/optimization in Unity/Unreal. Also, if possible, I'll like to learn (if you know some titles/webpages) from some free/paid mid/advanced tutorials/resources about art in games, optimization, engines, shaders... Thank you in advance, you are awesome! 🌻
@Acerola_t
2 жыл бұрын
Yeah! As time goes on I'll make more complex videos, got to talk about the simple stuff first. The only tutorial series I really recommend is catlikecoding, which ranges from beginner to advanced.
@bartholemumk1437
2 жыл бұрын
thicc fog incoming in 2022
@vylax836
Жыл бұрын
this is gold, Great video !
@candygonemad
2 жыл бұрын
For people who are using URP and struggling I was following along with the source code provided, however I realized after I made it all, that this doesn't work in URP. I finally got it working, and I used these sources to get there: Ned Makes Games's "Intro to Render Features Unity URP" tutorial on how to make a desaturate effect SamDriver's blog on Scriptable Render Features CyanGameDev's blog on shader terminology because this was my first shader I also converted the shader code into a shader graph myself. URP is very different in its architecture for shaders and rendering compared to whats shown in this video. In fact I believe that render features are not a thing in the standard render pipeline? Might be wrong about that. Hope this helps people.
@candygonemad
2 жыл бұрын
For example the OnRenderImage is not used, I set the materials properties (for the shader) in the Execute method of the render pass Also Graphics Blit is not used, rather the Blit method can be called and you pass in a CommandBuffer. From the Ned Makes Games video, he has a line thats like m_ScriptablePass renderPassEvent = RenderPassEvent something. To make it appear on the skybox set it equal to RenderPassEvent AfterRenderingSkybox. (cant add dots because scam protection)
@Acerola_t
2 жыл бұрын
Yeah this is why I use the built in pipeline, URP doesnt feel production ready lol
@candygonemad
2 жыл бұрын
@@Acerola_t it's tough because there are some very useful things that come with URP that I would hate to live without, especially on the 2d side, such as the 2d lights. But when documentation for some stuff sparse it really hurts to use URP
@wasdMash
5 ай бұрын
I've got everything else but the shader graph working now. Which nodes do I need to use to get the distance of objects to the camera?
@candygonemad
5 ай бұрын
@@wasdMash you can use the scene south node if you are just wanting the depth pass, or if you want like actual positions, your can get the world position of the object and then create a vector 3 variable that you can set to be the camera position in a script. Then use the distance node with those two
@ObviousDev
2 жыл бұрын
Just discovered your channel and it's been a blast watching through all your tech art related videos so far. Really good stuff! I love educational but also entertaining content. Keep it up
@RetroMMO
2 жыл бұрын
nice grass at 4:03 you should make a video about grass some time
@Acerola_t
2 жыл бұрын
That's a great idea ty
@Soundy777
2 жыл бұрын
Loving this content! More please
@Acerola_t
2 жыл бұрын
Thanks! new vids every 2 weeks :)
@rafertysullivan6085
Жыл бұрын
in unity go to window> rendering> environment and turn on fog
@Acerola_t
Жыл бұрын
that's crazy man this is about how that fog actually works tho
@rafertysullivan6085
Жыл бұрын
@@Acerola_t yeah i know I was just kidding
@felixconway
Жыл бұрын
It's the best video about fog out there
@Luiz-iy5ci
2 жыл бұрын
I'm a computer science student and thanks to your videos I'm now understanding why I've to study so much math, thx man 🤯🤯
I wonder if that's applicable for Godot Game Engine
@Acerola_t
2 жыл бұрын
The theory is universal
@puntangerslx2772
4 ай бұрын
fog cannot convert from shader to UnityEngine.shader
@CaveJohnson376
Жыл бұрын
welp, the way unity does depth processing is indeed cringe. for comparison, godot does shadowcasting passes only if they are actually needed and, furthermore, you can make it so certain selected objects don't cast shadows at all. oh, and all the opaque objects are rendered in same pass, and all of them write depth values to depth texture, without requiring to write separate shader function for shadowcasting pass. all simple, nice and easy.
@Acerola_t
Жыл бұрын
That's cool, Unity also does all of those things!
@xXBlackWorkXx
2 жыл бұрын
Dude, I just found your Video and it’s literally the exact fog like fog I need for my project. Is it possible that you could upload your project / fog files for download? I tried to understand your video and copy it but I am just not talented enough for „coding“ this kind of stuff…
@Acerola_t
2 жыл бұрын
The reference code is in the description! It's for Unity's built in pipeline though unfortunately.
@xXBlackWorkXx
2 жыл бұрын
@@Acerola_t yes I saw that! But yesterday the link was another one, or am I getting crazy?😂 now there are the files, thank you very much! I like your editing style for such videos. But what did you mean exactly by saying „it’s for unitys built in pipeline“, is that a bad thing?
@PotatosDispenser
2 жыл бұрын
@@xXBlackWorkXx If you don't know about it, it should not be a problem. Unity allows devs to specify how the graphics should be rendered. There are 4 modes : Built-in, URP, HDRP and Custom. It changes how lights and shaders work (among other stuff). So a shader written for built-in pipeline will not work if your project is setup with URP or others. By default, Unity Projects use built-in pipeline, so if you did not modify the graphics settings, this fog shader should work for you.
@Acerola_t
2 жыл бұрын
@@xXBlackWorkXx The fog shader files were in the old link but I changed it to the exact link after you commented lol Unity has several rendering pipelines, I like to use the built-in pipeline while others like to use URP or HDRP. It's not a bad thing, writing shaders for URP/HDRP is a bit different though but the concepts remain the same.
@davidj_bergman
Жыл бұрын
I love the vibe in this video! But unfortunately I still have no clue how to use this new knowledge...
@Sky-iv8zm
2 жыл бұрын
would absolutely love this video but for HDRP/URP using shadergraph or Amplify shader editor. Built-in has been on bug-fixes only for a few years now
@Acerola_t
2 жыл бұрын
The same concepts apply, I enjoy writing shader code over node based shader authoring so my videos will continue to be focused on that.
@kirillbrodski
Жыл бұрын
Heya bud, just dropping in to say great vid and channel. Hope you can take a break and focus on your mental health. Looking forward to crediting you and your content when my megahit game releases!
@rudyramadhana4127
Жыл бұрын
persona 3 dorm vibes lets gooooo
@flurinjenal374
5 ай бұрын
How much does the standard Unity fog impact performance for mobile games?
@user-cu4zj4pr4f
Ай бұрын
What "volumetric fog" means?
@surdno5796
5 ай бұрын
Is there any good reason to not use unity’s built in fog system though?
@Acerola_t
5 ай бұрын
there is plenty of value in having your own extendable system, also if you write any of your own shaders they are incompatible with unity's fog system unless you use their fog shader functions which good luck finding info for
@RatchetEden
Жыл бұрын
So Ive been working on this fog problem for a while, which rendering pipeline did you use for this, i couldnt get your script and shader working in urp
@Acerola_t
Жыл бұрын
it's for built in so not compatible with urp
@ShwetaSharma-su3il
Жыл бұрын
Hi I want to apply blit fog effects to a specific object not on the whole screen how can i do that?
@Acerola_t
Жыл бұрын
do it in the fragment shader as i demonstrated
@ShwetaSharma-su3il
Жыл бұрын
@@Acerola_t I want to apply fog on object only.
@Tenzordk
Жыл бұрын
Was wanting to add this to my small VR project, but sadly cannot be used without some fiddeling.. And I am not up to the task :D
@Acerola_t
Жыл бұрын
I mean, this is about as simple as post processing shaders get, but I understand!
@Tenzordk
Жыл бұрын
@@Acerola_t I just have not looked at shader.. As in at all 😊
@JustSomeGameDev
Жыл бұрын
my depression 😭💀
@Lam0rak
Жыл бұрын
As an Unreal dev this video is archaic
@Acerola_t
Жыл бұрын
unity has fog built in, this isn't really a video about engine specific implementations rather how a simple distance fog shader would work regardless of engine.
Пікірлер: 71