When a technique is discovered putting your current Blender knowledge on its head

What I’m saying is that do you have times when you thought you knew a lot about lighting technique, but then you discover a new one that gives superior results and makes you think of why you didn’t know of it before. Here’s one I’ve started to use that promises somewhat more realistic images then previously.

For years I’ve been using the tried and true method of using AO set to add to add realism to my scenes, works well but some drawbacks.

  • -No bumpmaps in the AO only lit areas
  • -Ambient lights will prevent the smallest nooks and crannies from being totally dark

Then I decided recently that I’ll use the compositor to make the AO pass (when it’s set to add), subtract light from the scene in the compositor rather than add to it, I don’t set AO to subtract mode because it’s not what you expect, it doesn’t subtract light in occluded areas that AO set to ‘add’ ignores, but we can make AO set to ‘add’ subtract light from occluded areas with the compositor, ambient and primary lights are set up first, the primary lights represent light sources and a small smattering of simulating bounces and atmospheric light, the ambient lights, useful for indoor scenes, create a somewhat flatly lit environment in areas not lit by the primary lights and even then flattens the lighting.

This is where the new technique comes in, I do an AO pass and have the AO occlusion distance fairly large depending on the scene seperate from the combined pass, I set a color-ramp node so the darkest/most occluded part is always black and non occluded/very open areas are white, the mix node where it’s combined with the render is set to multiply, so as to deliver the final shading for the final render, this technique has several theoretical advantages.

  • -Bumpmaps are seen, the ambient lighting rig makes the bumpmaps visible since all the AO does is subtract light.
  • -The darkest/narrowest nooks are always black, yet for other scenes you can reduce the power of the multiplication of the AO pass to control how dark the darkest nook in the scene is
  • -Really powerful way of lighting a scene provided you set the right value for AO power and distance

List the ways you’ve discovered great new Blender techniques, you thought you were a Blender expert, then something was discovered where your knowledge and what you thought you knew was upside down.

Thanks CD, I didn’t know AO was so flexible!

i’m happy you found a new way to use AO

now would it be possible to have a sample file
something very simple minimun scene that would demonstrate this new feature

it’s one thing to describe it but to do it is another one!

that’s probably why it was not discovered earlier

hope you can nake a Tut on this to show how to step by step
nodes are a little more complicated than normal material in blender

Thanks &

Happy blendering

isnt that very similar to just setting the AO mode to Sub instead of Add? havent tried it though, so tell me if im wrong.

The whole gamma and tone thing has helped me a lot… http://www.ypoart.com/tutorials/tone/index.php

Realising that the new Projection Paint (in 2.49) works well with image texture brushes - helping plenty with texture seams at the moment.

With bump maps, figured out they don’t render well on the sides of objects - but found a normal map plugin for Photoshop that converts them to tangent space normal maps that work great for minimal extra effort - http://developer.nvidia.com/object/photoshop_dds_plugins.html for Photoshop and http://registry.gimp.org/node/69 is basically the same thing for Gimp.

CD - would it be possible to show some renders or screencaps of the node setup to better visually explain what you mean? Text only goes so far explaining visual improvements.

I didn’t really get your explanation, CD, but I just wanted to point out that rendering ambient occlusion as a separate pass is generally a bad idea. The raw occlusion data is just information about how close to each other objects in your scene are, and needs to be combined with the rest of the scene lighting to make sense.

Personally, I find the best way is to just set to to Sub, and then adjust its strength (either globally or from materials) and that of your lights until it looks natural

A good rule of thumb is that the effects of AO should only be visible in shadowed areas – it’s there to give more depth to the shadows. Think of it as a substitute to having your fill lights cast shadows. Another way would be to substitute your fill lights altogether, by either using AO in Add mode, or making the ambient light (under World buttons) something other than pure black, with AO set to Sub. Since the only way you can control ambient light in Blender seems to be that single global setting, though, this probably gives less control.

Not that you don’t see AO used in all sorts of ways though – the Fanta ads by Psyop, for example.

interesting I have been trying out the very thing recently, I just read the 3D world article on killer bean where the animator said he multiplied his ao pass to the rest of his rendered and i thought to try it out.

Yeah CD, drop us a screen, or point us to a tut! :smiley:

Rendering AO as a pass and mixing it in with multiply is fairly common in other software

When a technique is discovered putting your current Blender knowledge on its head

It’s interesting, but hardly a massive shift in doing stuff that changes all before it… You do have a way with the “tabloid headline” though, I’ll give you that!

So you mean instead of baking AO maps and setting them to multiply for all my models I could have just done it all at once? Criiipes! There are so many dirty tricks to learn in CG, I think that’s part of the fun of it.

That was one thing I tried to do before I started doing this technique, setting AO to Sub instead of add won’t really do what you’d expect it to do, sure you get some darkened areas but it’s not the same. This happened to be more effective at doing that.

I have a scene where the difference could be seen between add/sub and AO pass set to multiple, I think I’ll get those rendered out.

Alright, I took a clay scene and rendered with AO set to add, subtract, and add set to multiply

AO set to multiply
Shows good depth in shading and no discoloration, grass doesn’t have as much depth as the rest of the images, but the blades look a bit better in the final scene with SSS and apparent close inspection shows it being more prone to quality loss from .jpg compression.

AO set to subtract mode and not multiplied onto the image
Similar result when power of the primary lamps is turned down to avoid washout, but some funny coloration in various areas similar to what you get when using the ‘subtract’ blend mode, coloration overall is a little different, grass has more depth.

AO set to add, ambient lamps toned down to try to get a similar result
Grass has more depth, but it looks flatter overall

Node setup

I haven’t looked through your original post properly yet CD but I had a bit of a Hallelujah moment when I read this blog post (it’s a blog by one of the authors of mental ray but the maths is the same no matter what renderer generates the AO pass)

That gave me a laugh when he compared the fake AO technique to the “real” Final gather technique!

As with all things art there are those that hate the “multiplied” look because it’s “incorrect”…

…and those that’ll choose whatever gives the look they want because they like it. Personally I prefer the dirty AO.

Yeah it’s true that whatever gets you to the image you want is valid. I suppose it depends what you think you’re adding when you setup the AO pass?
The ‘dirty AO’ technique for me doesn’t simulate lighting, but instead represents an accessibility pass that simulates how much dirt or grime the different parts of the scene have collected i.e. open areas of a model will be cleaned or worn away more than tight corners and recesses.

Blender does give you an option to make a render without the dirtyness.(see below)

Theoretically this can be done with Blender’s AAO algorithm as well, which that algorithm isn’t as dirty, but doesn’t give a lot of definition to things like small steps.

That situation is where Blender could eventually use a seperate AAO pass where an AAO and AO pass is generated so you can mix and match the best bits of both algorithms, the soon to come Blender 2.49’s interface is insufficient for a bunch of additional passes but the old interface is history and replaced with a better one after that release.

Although it’s clear that your not stating that he in particular is saying multiplying is wrong,
I just wanted chip in with that, from the blog post, as I understood it,
he is stating that whats wrong is multiplying it on the whole beauty pass,
when in fact you only want to apply the occlusion to the ambient lighting.

meaning you don’t want to affect the direct lighting with the occlusion pass, only the ambient one! :slight_smile:

I meant that sometimes affecting the direct lighting (or entire beauty pass)with the occlusion pass is a good effect… like dirt gathering in the nooks and crannies… Just depends on taste…

Besides the “correct” method only works with a high amount of ambient…

I’ve found that it’s ideal in many cases to combine AO with a Dome light rather than ambient… gives a much more “realistic” effect…

Well, like I mentioned, you can use AO “incorrectly” for effect, like in those Fanta ads. :slight_smile: But the fact remains that many (probably most) believe the correct way is to multiply the AO pass with the beauty pass in post. It’s even mentioned in books with names like Advanced Lighting Techniques in $bignamesoftware. I presume it is because back around when AO first made an appearance in 3D graphics, around 5-8 years ago, it was still kind of annoyingly slow, even though it was conceived of as a faster alternative to true GI, and people felt it’d be a good idea to just render it once and then spend more time on the rest of the lighting.

What you want to aim for (for realistic results) is this, basically:


The areas that are hit by direct light from a primary source (the sun, in this case), are evenly lit, with no gradiations. The shadows, on the other hand, are darker close to the shadow casting kitty^H^H^H^H^Hobject, and lighter towards the edges. This is because there’s ambient light bouncing around, lightening the shadows, and where there’s something closer to the surface receiving the shadow, more of it is blocked, and it doesn’t light up the shadow as much.

Here’s something I kind of incidentally rendered out for my thesis work the other day. Not the best of examples, but still kind of shows the point:


The top left picture is the key light only. Shadows are completely black. The top right is key and a fill light. Shadows are a more natural colour, but there’s no depth in them.

Bottom left is with key and fill lights, and AO set to Sub. The AO is set kind of high here, and the fill light is badly placed straight above, so the faces of the cube are a bit darker than they should be. Nevertheless, the shadow has added depth due to the occlusion. You can see that the lit side is still darkened slightly, but the aim is to adjust your lights and AO settings so that this effect is minimized. The default AO settings in Blender are a bit too high, I feel, and I usually lower them, either globally in the AO settings, or using the Amb slider in materials.

The bottom right shows the wrong way to do it. The AO pass is just multiplied on top, with no regards to scene lighting. The shadow looks the same as in the previous picture, but there’s unrealistic darkening of the light areas. This is multiplied in Blender’s compositor with a value of 1. By lowering the value, you can get rid of the unwanted darkening, but that means the occlusion effect will get lighter in the dark areas as well, so this gives you very little control.

As far as I can see there are two ways to make it look correct when multiplying the AO on in post. One is to use a renderer (not BI) that lets you link AO to the lights, so that it only appears in the shadows of certain lights. The other way is to render out a shadow pass along with the AO, and use that as a mask when multiplying. Probably extremely hairy if you have a complex scene.

Disclaimer: this is mainly based on the link Bliz posted, and my own experiments and observations.