How to CORRECTLY use AMBIENT OCCLUSION [Blender Tutorial]
ฝัง
- เผยแพร่เมื่อ 18 ก.ค. 2023
- I'm here to settle the score on how to use ambient occlusion in Blender CORRECTLY. None are without sin.
Blender Manual - "Shader To RGB":
docs.blender.org/manual/en/la...
Blender Stack Exchange post:
blender.stackexchange.com/que...
ASSETS USED:
Rustic Brick 2:
www.textures.com/download/PBR...
Coastal Cliff 2:
www.textures.com/download/PBR...
Tufted Leather:
www.textures.com/download/PBR...
Hammered Copper:
www.textures.com/download/PBR...
Wood Trim:
www.textures.com/download/PBR...
Old Metal (legacy):
www.textures.com/download/Sub...
Timbered Brick Wall:
www.textures.com/download/PBR...
SciFi Panels 09:
www.textures.com/download/PBR...
HDRI Japan Kabuchiko Night:
www.textures.com/download/HDR...
HDRI Faroer Bay A:
www.textures.com/download/HDR...
Earth model by Denis Cliofas:
skfb.ly/6VCKF - ภาพยนตร์และแอนิเมชัน
Warning: Shader to RGB disables Screenspace Reflections and Subsurface Scattering.
Yeah, I am sadly aware. Until Blender Foundation officially supports AO maps for EEVEE, that's the biggest trade-off.
@@NovanByworks I spent an hour trying to figure out why reflections were missing and then I checked google lol
I hope Eevee Next will support AO, someone should tell that dev if they haven't already.
@@Zev_Reef There's been a request on Right-Click Select for a few years now, but I've still not heard any explicit plans to incorporate it. My guess is that because EEVEE was originally developed to have near-parity with Cycles, they didn't consider what features it would need between shared shaders. This is why the Specular shader still has an AO input while Principled does not.
I cannot even find this shader to RGB in blender 4.0 :D
I think the normal method work good anyways i was needing only to preview how it is working before put it in engine.
Okay, so that makes this technique highly situational
FINALLY!!! An actual solution to a problem that haunted me for so much time but weirdly no one talks about. Thank you SO MUCH!!!
Such a simple method yet adds so much to a render. Thx for sharing I'm definitely adding this to some of my old project files!
You deserve more subscribers, good editing, explaination with humor.
Thank you very much for the valuable input. I wish you success on your Blender video career. It was short, concise, not distracting, basically excellent as far as video editing is concerned. You addressed the targetted public right away, kinda advanced/knowledgeable users of Blender.
One of the best tutorials of blender i ever saw!
Thankyou so so much!
Thank you for sharing this. It really help me while working on my commercial projects
Wow! Great explanation bro,basic understanding and great speech - style also...❤
Very nicely explained 😊😊thanks! I recently started looking into Maya hypershade utility nodes and nodes in general, am a bit slow understanding stuff, but it is so interesting
I love how Blender goes out of it's way to be extra difficult, and time consuming instead of focusing on more intuitive, and less time consuming. lol... But I love it!
This was very enlightened
Excellent video.
now that was interesting. I'll try to use that way more now :)
Wow that was cool
please do more of this 🙏🏻❤
thanks, actually helped me with ao shaders
very nice
I always knew this so I resorted to never use thinking that AO might be a technique for old times when Raytracing wasn't as efficient and PC's weren't strong so they faked GI using AO. Hence why also used in games. So basically AO is indeed in genuine use, just that it is being wrongly used by everyone.
Make more tutorials. You have a unique appeal that will get you far.
my hero
I love this video lol.
This should be implemented on the Principled BSDF shader... up until today I still don't know why it just doesn't have the AO input!?
Yeah, seems like a pretty big oversight. There's been a feature request on Right-Click Select for 3 years, but no response.
I mean with a displacement map you get pretty good AO and also it just looks better in general sooo a AO texture is pretty much useless if you have a height map
@@johanavril1691 This is true, but I only included the segment on Cycles just to show one way AO could be controlled if the user so desired.
@@johanavril1691 That may be correct for cycles, but for Eevee the AO helps substantially!
@@rogper oh yeah of course!
I get crossed eyed when using Blender's nodes. Seriously, I'm amazed at how people remember or simply know what the hell to do when you connect this to that to this.
Part of it is practice, but it helps to know what each node actually does. It's a little outdated, but I recommend Daniel Krafft's video covering them here:
th-cam.com/video/cQ0qtcSymDI/w-d-xo.html
It's also good to refer to the official Blender docs for anything confusing. They should give you a good idea of how things work and what you're allowed to do, such as which nodes work in Cycles or EEVEE.
I am learning how to create cs2 skins and that glow in the dark effect seems really interesting to apply in the game. Would you make a detailed tutorial about how can you achieve this effect and how to bake the occlusion sheet?
To create the glow/light effect, you just use the same setup for an emissive map rather than the AO map. As for the "occlusion sheet", I'm not sure I understand what you're referring to. Your material should already have an ambient occlusion map, and if not, you either have to make one in an image editor or bake it from actual geometry.
Soooo, lets just say that I have a character and a point light, after seeing this video I understand that the more illuminated sides of said character Will have less AO while the lessers Will have more?
Would that be correct? (This may be a dumb question but It would help me xD)
wow more of these vids please!! EVERYDAY LESSONS lol lol I tried this and it didn't work, missing something basic I think. Also, love how you explain what an AO is, i mean.. i knew that... or did i??? how does sheen and specular work??? as a fabric artist I need to know these things =D ytytyt for the videos
Alexa: How do I permanently engrave this information on my brain?
The eevee part was really good but using an entire new viewlayer as a mix factor for making the ao darker is a really weird idea I mean you could just turn on a few more passes and get basically the same (or better) result without rendering the scene twice
I was mostly trying to find a way to make more accurate use of the AO pass since it's doesn't take light sources into account, hence the pseudo-falloff pass. It is definitely hacky and I wouldn't personally use it, but I still included it just to show a Cycles equivalent.
FULLY CORRECT SEEN BELOW!
~ Writing in caps here because I'm trying to solve this issue, and this YT video gave me what I needed to solve it (Shader -> RGB), but the solution given wasn't working in all cases for me.
Here is the correct math that works across many PBRs that I tested:
Starting Configuration: Textures => Principled BSDF -> Shader Output
Here's what you will do (Probably putting this all in a Shader Group),
- Take the Ambient Occlusion, and multiply it with albedo (Call this node NODE_Z). Then, take the Metal texture, invert it, and multiply with NODE_Z to get NODE_Y.
- Then, add Principled BSDF -> Shader to RGB; VectorAdd this result with NODE_Y, and connect the output of this VectorAdd to your Shader Output.
This now _adds_ ambient lighting (The YT tutorial doesn't actually brighten up the texture, it only darkens, which is incorrect); and, it works correctly on textures with metal in them (This YT tutorial breaks on any texture with metallicity).
You can also multiply Ambient Occlusion with any number (1, 2, 3, 4) to match the "Ambient Light" setting in your game engine (UE, Unity, Godot), and the result should match 1:1 with the game engine. This adjusts the intensity of the ambient light. You even multiply by a color to give the ambient light a tint.
Overall, the formula is this:
ambient_light = ambient_intensity * ambient_tint * ambient_occlusion; // intensity is a float, the other two are vector3's
ambient_light *= albedo;
ambient_light *= 1 - metallic;
BSDF_RGB += ambient_light;
// If you have a PBR without an AO map, set ambient_occlusion = vector3(1,1,1), so that lighting is still equal across all PBRs in the scene.
Hope this helps!
How'd you get the little image previews above your nodes? :0
It's an add-on called "Node Preview". It's a tad pricey but very useful. You can buy it here:
blendermarket.com/products/node-preview
99% of blender youtubers are just affiliate marketers. They don't know anything beyond the surface level.
not at all. most of them are just repurposing the AO node to make a quick dirt/grime/dust mask. it has nothing to do with light.
Can you make a vid on portal light property in area light
I'm not familiar with that as I typically work in EEVEE. It's a little outdated, but this seems like a pretty good explanation: blender.stackexchange.com/a/33877/66794
Tried it for cycles. I added layer "solidrender" and cant find it in "override". I don't understand what i did wrong
While in the "SolidRender" view layer, create a blank white diffuse material and set that to the override. This will make everything use this material when the layer is rendered so it will only show AO and lighting. This layer then gets multiplied on top of the original Scene layer in the compositor.
Thank you! 😊@@NovanByworks
1:21 “You might as well just merge the AO map into the albedo map to save yourself the extra draw call.” I thought a draw call was just an instance of a mesh or an instance of a material applied to one? I don’t have that much experience in draw calls, so any of us could be wrong, but I’m open to learning more.
Best I can tell, it depends on the rendering engine itself. This might not actually be true for EEVEE, but uselessly rendering the AO on top of the albedo is still less performant than just merging them into the same image. Game engine shaders tend to separate the AO map because of the way it's supposed to react to light, which may result in an extra draw call depending on the shader model used.
did you read the "warning" on "shader to rgb" ? according to that it disables reflection and SS scattering !?
True, so I suppose that's the tradeoff: Have proper AO, or have SSS & reflections.
You can still have baked cubemap reflections, but until Blender Foundation adds proper AO support, this is the best solution I've come across.
BASED = SUBBED
I use math(power) and it works much better. Also I don't know why there is still no AO socket in Principled BSDF
I would guess that it's because Principled was originally created for Cycles, which generally doesn't require AO maps the same way real-time engines do. And now not enough people even know how to properly use them to ask for its inclusion (hence this video).
Interesting idea about the Math node. Would you mind sharing how to incorporate it?
@@NovanByworks I do the same thing as everyone else, as at 54 seconds. The only difference is that I add a math(Power) node between the AO and the Mix node. And that gives much better control.
Hm, i just used the AO node and plugged it between the bsdf and the output in cycles.
The issue is that the AO node is only generative and does not take light sources into account. This is useful for procedurally blending textures/materials at mesh corners for effects like weathering, but not for actual realistic ambient occlusion.
I guess eevee and cycles are both complicated since there are things cycles cant do but eevee can and vice versa xd
Pretty much. General rule seems to be that Cycles is best suited to photo-realistic rendering while EEVEE is best suited to stylization/NPR.
this only works for eevee?
Yes, specifically "Shader to RGB" is exclusive to EEVEE.
I need AO in cycles :(@@NovanByworks
Great trick. I understand the steps, but why does it work? It's basically killing the AO map under direct light - how does a diffuse shader to rgb in the mix do that? What? Great video, but this is one of my complaints about a LOT of online tutorials: they go through the right steps, but don't always explain the what's and whys. So I don't learn them, just what options to click.
I quickly glossed over it in the video, but ambient occlusion simply refers to the occlusion of ambient light, also known as "indirect light". It's the natural shadows exhibited by creases and cavities that ambient light cannot reach (think of an overcast day). When a direct source of light is shone on them, these shadows disappear.
"Shader To RGB" effectively exposes the raw color data of a BSDF shader, i.e. what's lit and what's not. Thus we can use this data like a mask to control what parts of an AO map are revealed under direct light and what parts are not.
Normally AO occurs naturally in path-traced rendering such as with Cycles, but game engines use pre-baked AO maps to save on performance for real-time rendering. EEVEE is also real-time but lacks that same support for AO maps, so we use Shader To RGB instead. The tradeoff is that this disables screen space reflections and subsurface scattering. Until Blender adds real AO map support, this is my interim solution.
Nice, thanks for the reply! So it's really about "reverting" back to the pure color of the shader, which emulates the effect of being in direct light. I totally get it, thanks again.@@NovanByworks
I tried to conduct experiments and I got the impression that this does not always work. The Ambient Occlusion node works more stable than Diffusion + Shader to RGB. 🤔
The issue is that the AO node doesn't take light direction into account or allow you to use pre-baked AO maps.
@@NovanByworks Agree. It makes sense. Then it might be worth combining both approaches. Since the AO node also has its advantages.
I'm so confused. Ima go back and make a second cube.
I wanna go home
my mind farted but it was very helpful nonetheless
!!!!!!
Wrong wrong wrong! Calm down, dude, you’re going to give me a stroke!
PS: Great vid!
_This is a joke._
_These guys are cool . . ._
for a short time after you pull them out of a freezer. Again and ag . . .
Nah, srsly, they cool.
P.S. The slaps you thown . . . I . . . felt them like it was me who shouted again and again how to incorectly use the Ambeyond Conclusion.
ive heard that there is no ambient occclusion in real life thus cycles doesn't use it by default
Sure, it's more a term to describe a shortcoming of real-time rendering. I only covered using it in Cycles because I was unsatisfied with the implementation of the AO pass.
Witchcraft!
Nice video, but please slow it down. I can barely see what you're doing without slowing the video down or going back a bunch of times
I like to edit for a brisk pace to keep things succinct. You can turn on subtitles and/or change the video speed if you need.
i don't think this is correct. you are not supposed to bake in any lighting information in your diffuse. that's not the way pbr works. the principled bsdf should have its own dedicated ao input.
Correct, which is why I was basically joking about that. This whole setup is just a stopgap until Blender adds AO support to the Principled BSDF (assuming they ever do).
This would have been interesting, presented competently, slower spoken, not madcap.
I like to make my tutorials as concise as possible. I have included subtitles if you need to take time with the instructions.
are you 1.5xing your voice? it feels way to fast...
I've included subtitles and you can change the video speed.
There is no "solid render layer", you lying.
At 3:22, you can see me create a new View Layer named, "SolidRender".
Where are find a shader RGB ? It's a joke. Somebody try it ?
The 'Shader to RGB' node is in the 'Converters' category. It is only usable with EEVEE.