How to add ambient occlusion texture blender

How to add ambient occlusion texture blender

Want to master Blender? Click here! and get our E-Book

Ambient occlusion comes in many shapes and sizes and it can be hard to understand what it really is all about. Let’s see how what and where ambient occlusion or AO as it is shortened is present in Blender and what we can do with it.

Ambient occlusion is an effect that can be used to add contact shadow in crevasses, detail areas or where different objects meet in a digital 3D world. The effect was introduced to simulate more realistic shadows. With the introduction of ray-traced render engines the realism is solved within the renderer itself. But we can still add it as an effect even in these kinds of render engines.

Let’s see how Blender implements the different variations of ambient occlusion and how we can use them.

What is Ambient Occlusion?

Ambient Occlusion is the idea that where objects meet, less light will be able to find its way in and shadows appear in those areas. It is most seen around detail and crevasses.

However, no shadow without light, so we can also think of Ambient Occlusion as the biproduct of soft light. As light fades away when it tries to get in between objects, Ambient Occlusion takes over and fades edges around and between objects into shadow.

When adding ambient occlusion into our scenes we often introduce more contrast between the detail areas where ambient occlusion becomes more prominent and plainer areas with less detail. This is often a desirable effect to have, but as always, it depends on the artists goals and choices.

What is the difference between ambient occlusion and ambient light?

Ambient Occlusion is a term used in digital 3D graphics to describe contact shadows. Ambient light on the other hand is mostly used by photographers. When a photographer refers to ambient light, they mean light that is naturally added to a scene. It can also be thought of as the lighting starting point.

The photographer has limited control over the ambient light. It can be daylight or artificially added light. The ambient light influences the photos shot and can be both useful and a hindrance for the photographer. The quality of the light does not matter, it can still be considered ambient light.

With this background in mind we have a version of ambient occlusion in Blender that comes close to resembling an ambient light rather than an ambient occlusion as we know it. The terminology can be a bit misleading here.

What types of AO are there in Blender?

There are several ways we can have ambient occlusion in Blender. It differences between Eevee and Cycles. It is available both on a global scale as a post processing effect or as part of the world settings directly in Cycles. But as we just brought up, this kind of ambient occlusion in Cycles, is more like ambient light.

Another way to globally enable ambient occlusion is to use the Ambient occlusion pass in Blender and enable it as a post processing effect through the compositor.

We can also create several types of local ambient occlusion effects. These range from shader based to texture based.

At last, we can also bake ambient occlusion to textures that we can use for our assets either internally in Blender or externally, for instance, in a game engine. Here is a list.

We can also use ambient occlusion in the viewport to help us see detail as we work.

Let’s cover them one by one.

Cycles ambient occlusion world settings

This ambient occlusion is rarely used in final renders, at least as far as I know. We can try to use it in interior renders if we have problems with fireflies or we can use it to light up a scene or asset for test renders.

What it does is that it adds ambient light to the scene and overrides global illumination. Ambient occlusion is really a biproduct of accurate rendering with a ray-tracer like Cycles. This means that we don’t really need to turn this on. We already have it as part of global illumination.

But let’s see what it is, you may still find it useful.

To add ambient occlusion in Cycles go to the world settings tab in the properties panel and find the Ambient Occlusion section and enable it on the checkbox.

When you enable this your scene will light so that it overpowers your existing light setup. This is what we earlier touched on as being ambient light rather than ambient occlusion.

My understanding here is that this kind of ambient occlusion overrides Cycles global illumination or adds to it according to the factor value we find in the settings.

According to the manual the factor setting simulates soft global illumination. A factor of 1.0 is supposed to mimic the use of a white world color in the settings just above.

We also have a distance value. This determines how far away objects can be to contribute to the shadows created by the effect. Lower values will bring more light to your scene. If you go to the extreme, crevasses and detail can even seem to light up instead of becoming covered in shadow.

You should be aware that this kind of ambient occlusion breaks the physical accuracy of the render engine.

There is another setting relevant for global ambient occlusion in cycles. In the render tab we find the simplify section. If we expand the viewport and render subsections, we find AO bounces.

If this isn’t set to zero, ambient occlusion will take over after the specified number of bounces. For instance, if we set this to two, we will let global illumination do two bounces in the scene before AO takes over.

Even if this ambient occlusion fakes light and breaks the physical accuracy, a benefit is that it is performance friendly and can help reduce fireflies in interior renders.

Ambient occlusion with Eevee

In Eevee, ambient occlusion is a post-processing effect. We find it in the properties panel among the render settings. Open the Ambient Occlusion section to reveal the properties. To enable it, press the checkbox on the section headline.

In Eevee, ambient occlusion makes much more sense. We rely mostly on information gathered from different views. For instance, the screen space, maybe a reflection plane, which is just another view to add information to the scene or an irradiance volume that samples light so that we can emit bounce light according to that sample location.

Overall, we are just gathering information from different perspectives of the scene to make it complete.

It only makes sense to add ambient occlusion into the mix so that we can utilize all the available information to create the render we want.

I recently authored another article covering the Eevee render settings that you can find here:

For completions sake, we will cover ambient occlusion in Eevee here as well. But for an alternative view and more in depth, check out the article above.

The distance parameter adjust how far away surrounding objects can be to still contribute to the AO. A higher number will result in more and darker shadow.

The factor blends AO on top of the original image. with a factor of zero we have turned off ambient occlusion. Note though that the slider goes from 0 to 1 but we can type a higher number into the field. We can, for instance, have a factor of five hundred if we felt that it was a fair value.

The trace precision is a bit tricky, it short, don’t touch it. But if you have artefacts you can adjust this to see if it solves the problem. It will give you a performance hit in complex scenes but may sometimes solve those problems.

The bent normal refers to the angle most light hits the surface as opposed to the tangent normal witch is the direction the face is pointing. It is supposed to give slightly more accurate ambient occlusion.

As far as I know, it doesn’t have a performance impact. So, in general, we want this to be on.

The last setting, bounce approximation takes the light hitting an object into account. An object with more light gets less occlusion. This is a good setting to leave on as it increases realism.

In Eevee ambient occlusion is a much more essential tool than in Cycles. It gives us more control over our scenes. For instance, we may have irradiance volumes that give excessive light in some areas while providing good indirect lighting in other areas. In those cases, we can use ambient occlusion to dial back the indirect light where it is less desired.

Many different techniques play together to get a nice final render in Eevee, and ambient occlusion is one of those tools.

How the AO Shader node works

The AO shader has limitations in both Cycles and Eevee right now. Some of the settings in the node only works in Cycles while Eevee depend on the global settings for this shader.

Using Cycles, we can’t render the AO node with GPU and Optix. We must fall back on Cuda for Nvidia graphics cards. If we have an AMD card, we can use OpenCL.

The AO node is also relatively expensive in terms of performance in Cycles. If we need maximum performance, we may benefit form baking ambient occlusion instead. We will touch on that further below.

Let’s start in Eevee. We can use the color and normal inputs. The distance is Cycles only and instead; we use the global post-processing settings in the render tab. This means that we can’t have different distances for different shaders. But we can still work around that by adding a color ramp node after the ambient occlusion node.

All properties without an input or output node are also cycles only. This leaves us with the Color and AO outputs for now.

If we turn off global ambient occlusion the AO output will stop working. But the color output will work either way.

Here is an example.

We are using Eevee and ambient occlusion is turned on. We can put a color or use a texture as input in the ambient occlusion shader that we pass to the mixRBG node.

The AO output is piped to a colorramp so that we can adjust the AO effect. In this case I turned up the black a lot to make it very prominent in the occluded areas. Then I added a green tint before the ambient occlusion shadow fades away.

We mix this back with the color in the mixRGB node set to multiply with the factor slider set to 1. We can lower this value to fade away the ambient occlusion effect.

Thanks to the compatibility between Eevee and Cycles we can use the same node setup, but in Cycles the other settings are used as well.

You can see that there is some difference in color, we can probably tweak the scene to make them more similar. But that is not why we are here. The overall effect is the same. You can see the similarities. Now, let’s go through the rest of the settings applicable to Cycles.

The distance input should be clear by now, it tells how far away other objects can be to influence the ambient occlusion.

The sampling setting determine how many rays are cast. More samples mean smoother ambient occlusion. But too many samples also have a performance impact. You want this as low as possible while still clearing up noise. If the AO doesn’t clear up enough, we can complement it with denoising. At least for still images.

The inside checkbox switches the ambient occlusion around so that peaks rather than crevasses are detected.

Only local change the node so that only the object itself influence where the ambient occlusion goes.

Both settings are especially useful when using the AO node to create masks. Something that this node is very commonly used for.

How to use an Ambient occlusion texture map

We can use an ambient occlusion map to increase contrast and put emphasis on details and crevasses locally for a single object or as part of a texture set. This is less computationally heavy than the ambient occlusion node but instead, it costs RAM. We need to strike a balance between RAM usage with pre-baked assets compared to straight up calculating at render time.

Some textures are baked specifically for one object. This is often the case for textures used in games and real-time applications. Another kind of texture is a seamless texture. An Ambient occlusion map can be part of a seamless texture set as well together with other PBR maps.

Both kinds of texture can be used in the same way. Only the first example needs to match the texture to the correct object, obviously.

We can use an AO texture as it is meant, to create shadow in crevasses and detail areas. But we can also use it as a mask or combining it with other textures to create a more complex masks just like with the ambient occlusion node.

Here I will show you how we can use it the traditional way.

The simplest way is to combine the AO map with the diffuse or albedo texture through a mixRGB node set to multiply, then use the factor slider to adjust how much of the AO you want to come through.

Here is a node setup example:

The texture is from texture haven and we use the diffuse, roughness, normal and displacement texture together with the AO. The lighting is just the sky texture that was introduced in Blender version 2.90.

This first example is the node setup above.

In this next example we use no ambient occlusion texturue, instead we plug the diffuse straight to the principled BSDF.

This last example is with the AO node plugged into the lower socket of the mixRGB node instead. We could further tweak this with a color ramp node if we wanted. Keep in mind that this image takes significantly longer to render since I could not use Optix and had to fall back on Cuda combined with the longer render time for an AO node.

Personally, I think the first result is the best where we include the AO texture. Still, I rarely come around to use them.

How to use ambient occlusion in the compositor

Ambient Occlusion in the compositor works well when we want AO across the whole scene, and we need some more control after we completed the render. Using the AO pass together with a colorram,p mix node or a curve are a few examples of how we can adjust the AO pass and combine it with the original footage. It is like how we do it in the shader editor.

To use ambient occlusion in the compositor we need the AO pass. To enable this in Eevee we first need to enable ambient occlusion in the render settings. For Cycles, there is no prerequisites.

The passes can be found in the view layer properties tab in the properties panel. Find the passes section and light subsection.

At the bottom you will find the Ambient Occlusion pass. Enable it before you render your scene.

Once the scene is rendered, we can access the pass in the compositor. Go to the compositor workspace and press use nodes.

In the render layer node, you will have an AO output. connect it to a color ramp node and the colorramp to the bottom socket of a mix node. Then set the mix node to multiply.

Connect the image to the top color socket in the mix node and the mix node to the output.

Now we can use the color ramp and the factor to adjust the amount and level of the AO.

How to bake ambient occlusion

Baking ambient occlusion isn’t much different than baking any other pass in Blender. There are two ways we can bake ambient occlusion natively in Blender. We can either bake the AO pass for our selected object or we can setup a shader that ends in an emission shader and bake the emit pass.

Let’s go over how we bake the AO pass first. These are our requirements

Keep in mind that Optix does not support baking so if you are on an Nvidia graphics card, you likely have to switch to Cuda or bake with the CPU.

Make sure your interface is setup so that you have both the shader editor and a 3D viewport accessible, then go to the properties panel and find the render tab.

In the bake section set the bake type to ambient occlusion, select your object in the 3D viewport and select the disconnected image texture node with the loaded image. Then press bake in the properties panel.

When the bake is done, don’t forget to go to the image editor and save your baked image.

The second way is to bake an emit pass. The difference here is that we don’t bake the actual AO pass, instead we setup a shader to mimic ambient occlusion. Most likely using the AO node and a colorramp to adjust it.

This is the node setup.

Make sure to select the image texture node and switch from ambient occlusion to emit in the baking section then press bake.

Ambient occlusion in the viewport

There is also a feature we can enable if we want to have ambient occlusion in the viewport as we model. This can help us see detail more clearly as we work. It is called cavity and is a viewport shading feature we can turn on in solid viewport mode or in the workbench engine.

Keep in mind that this kind of ambient occlusion can also be performance heavy. You will have to weight that in as you use it. The upside is that it looks nice in the viewport.

To enable it, set the shading mode to solid and open the viewport shading menu with the arrow button found in the top right corner.

In the options section check cavity and a few extra settings will appear.

We can have world, screen space or both types of cavity enabled. Screen cavity is faster but doesn’t take the geometry into account while world is more accurate.

We can also adjust the intensity for valleys and ridges.

Final thoughts

By now you realized that Ambient Occlusion is a diverse topic and sometimes a bit confusing. When we hear the term ambient occlusion it can be hard to know what is meant at first. After reading this guide, you are better prepared to use ambient occlusion. I also think you are better prepared as you hear about ambient occlusion elsewhere and you will easier be able to understand what kind of ambient occlusion is being referenced.

World SettingsВ¶

Ambient OcclusionВ¶

Panel:World ‣ Ambient Occlusion

Ambient occlusion is a lighting method based on how much a point on a surface is occluded by nearby surfaces. It simulates soft global illumination shadows by faking darkness perceived in corners and at mesh intersections, creases, and cracks, where ambient light is occluded, or blocked. This is a trick that is not physically accurate, but it is useful to emphasize the shapes of surfaces, or as a cheap way to get an effect that looks a bit like indirect lighting.

Factor The strength of the ambient occlusion; value 1.0 is like a white world shader. Distance Distance from shading point to trace rays. A shorter distance emphasizes nearby features, while longer distances make it also take objects farther away into account.

Lighting from ambient occlusion is only applied to diffuse reflection BSDFs; glossy or transmission BSDFs are not affected. Transparency of surfaces will be taken into account, i.e. a half-transparent surface will only half occlude.

An alternative method of using Ambient Occlusion on a per-shader basis is to use the Ambient Occlusion shader.

Mist PassВ¶

Panel:World ‣ Mist Pass

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Mist can greatly enhance the illusion of depth in your rendering. To create mist, Blender makes objects farther away more transparent (decreasing their Alpha value) so that they mix more of the background color with the object color. With Mist enabled the further the object is away from the camera the less its alpha value will be.

Start The distance from the camera at which the mist starts to fade in. Depth The distance from Start of the mist, that it fades in over. Objects further from the camera than Start + Depth are completely hidden by the mist. Falloff

The curve function that controls the rate of change of the mist’s strength further and further into the distance.

Quadratic Uses the same calculation as light falloff ( \(1\over\) ) and provides the smoothest transition from transparent (0.0) to opaque (1.0). Linear Has a steeper start than quadratic ( \(1\over\) ). Inverse Quadratic Has the steepest start ( \(1\over<\sqrt>\) ) and approaches 1.0 faster than the other two functions.

A visualization can be activated in the Camera ‣ Display panel.

Because Mist works by adjusting transparency, this can sometimes cause objects to be partially transparent when they should not be. One workaround is to set the Mist settings as desired, but turn Mist off. The Mist data is still available for compositing even though it is off. Use Compositing to feed the Mist pass to the Alpha Over node to blend the background color (or a render layer with just the sky) with the rendered image. This produces the mist effect but since Mist is off the object transparency (or lack of) is preserved.

SettingsВ¶

Panel:World ‣ Settings

SurfaceВ¶

Enabling this will sample the background texture such that lighter parts are favored, creating an importance map. It will producing less noise in the render in trade of artifacts (fireflies). It is almost always a good idea to enable this when using an image texture to light the scene, otherwise noise can take a very long time to converge.

Below is a comparison between Multiple Importance Sample off and on. Both images are rendered for 25 seconds (Off: 1500 samples, On: 1000 samples).

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Multiple Importance Sample off.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Multiple Importance Sample on.

Map Resolution Sets the resolution of the importance map. A higher resolution will better detect small features in the map and give more accurate sampling. but conversely will take up more memory and render slightly slower. Higher values also may produce less noise when using high-res images. Max Bounces Maximal number of bounces the background light will contribute to the render.

See Reducing Noise for more information on how to reduce noise.

VolumeВ¶

Interpolation method to use for the volume.

Linear Good smoothness and speed. Cubic Smoothed high-quality interpolation, but slower. Homogeneous Volume Assume volume has the same density everywhere (not using any textures), for faster rendering. For example absorption in a glass object would typically not have any textures, and so the renderer can be set to avoid taking small steps to sample the volume shader.

Ray VisibilityВ¶

Panel:World ‣ Ray Visibility

As with other objects, Ray Visibility allows you to control which other shaders can “see” the environment.

TricksВ¶

Sometimes it may be useful to have a different background that is directly visible versus one that is indirectly lighting the objects. A simple solution to this is to add a Mix node, with the Blend Factor set to Is Camera Ray. The first input color is then the indirect color, and the second the directly visible color. This is useful when using a high-res image for the background and a low-res image for the actual lighting.

Similarly, adding the Is Camera and Is Glossy rays will mean that the high-res image will also be visible in reflections.

Ambient Occlusion¶

Ambient Occlusion – это сложный алгоритм трассировки лучей, который имитирует мягкие тени от глобального освещения путём фальсификации темноты, воспринимаемой в углах и на пересечениях полисеток, в сгибах и трещинах, где окружающий свет закрывается или блокируется.

There is no such thing as AO in the real world; AO is a specific not-physically-accurate (but generally nice-looking) rendering trick. It basically samples a hemisphere around each point on the face, sees what proportion of that hemisphere is occluded by other geometry, and shades the pixel accordingly.

It is got nothing to do with light at all; it is purely a rendering trick that tends to look nice because generally in real-world surfaces that are close together (like small cracks) will be darker than surfaces that do not have anything in front of them, because of shadows, dirt, etc.

Процесс AO, тем не менее, аппроксимирует этот результат; он не имитирует свет, отражающийся от расположенных вокруг поверхностей или проходящий сквозь предметы. По этой причине АО работает даже тогда, когда у вас в сцене нет никакого освещения, и именно поэтому простое включение AO – очень плохой способ «осветить» сцену.

Чтобы AO заработал, вам необходимо включить трассировку лучей на панели Затенение вкладки Визуализация.

Также у вас должен быть цвет окружения, установленный по вашему желанию. По умолчанию цвет окружения (мира) является чёрным, имитируя полночь в подвале во время отключения электроэнергии. Применяя этот цвет в качестве цвета окружения, вы затемните все цвета. Хорошим цветом для открытых сцен середины дня является RGB(0.9, 0.9, 0.8), который представляет собой беловато-жёлтый солнечный цвет в яркий-но-не-ослепительно-яркий день.

Параметры¶

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Панель окружающей среды с подсвеченными ползунками цвета среды

В процессе визуализации Ambient Occlusion смешивается с основным изображением. Доступно два режима смешивания:

Добавить Пиксель получает свет соответственно количеству не закрытых лучей. Сцена становится светлее. Этот режим имитирует глобальное освещение. Умножить Ambient Occlusion умножается на затенение, делая объекты темнее.

Если выбрано умножение, в сцене должны быть другие источники света; в противном случае сцена будет чёрной, как смоль. В двух других случаях сцена будет освещена эффектом АО, даже если в ней нет явного источника света. Хотя многие люди любят использовать AO в качестве быстрого способа освещения сцены, результаты, которые он даёт, будут приглушёнными и плоскими, как пасмурный день. В большинстве случаев лучше всего освещать сцену с помощью стандартных ламп Blender’а, а затем использовать поверх них AO с режимом Умножить для подчёркивания деталей и теней.

Панель Сбор содержит параметры качества отражённого Ambient Occlusion. Обратите внимание, что эти параметры также применяются к освещению от окружения и к отражённому освещению.

Для вычисления Ambient Occlusion используется один из двух методов: трассировка лучей или приближённый метод.

Трассировка лучей¶

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Панель «Сбор», метод «Трассировка лучей»

Трассировка лучей даёт более точные, но также и более шумные результаты. Вы можете получить изображение почти без шумов, но для этого придётся пожертвовать временем визуализации… Это единственный вариант, если вы хотите использовать цвета текстуры вашего неба.

Затухание Length of rays defines how far away other faces may be and still have an occlusion effect. The longer this distance, the greater impact that far away geometry will have on the occlusion effect. A high Distance value also means that the renderer has to search a greater area for geometry that occludes, so render time can be optimized by making this distance as short as possible for the visual effect that you want.

Метод сэмплирования Равномерный QMC Базовый метод квази-Монте-Карло, дающий равномерное и случайное распределение лучей. Адаптивный QMC

Улучшенный метод квази-Монте-Карло, который пытается определить, когда можно понизить количество выборок или вообще их пропустить на основе следующих двух параметров:

Порог Предел, ниже которого выборка считается полностью закрытой («чёрной») или не закрытой («белой») и пропускается. Адаптация к скорости Коэффициент для уменьшения количества выборок AO для быстро движущихся пикселей. Поскольку он использует проход визуализации Вектор, тот также должен быть включён (смотрите страницу с описанием проходов визуализации ).

О методе квази-Монте-Карло

See also the ray-traced shadows page for more info about the Quasi-Monte Carlo sampling method.

Исторический метод выборок, более подверженный артефактам «погрешности»…

Настройка погрешности позволяет вам контролировать, насколько гладкими будут «гладкие» грани при визуализации AO. Поскольку AO рассчитывается по исходной гранёной полисетке, может случиться так, что свет от AO сделает грани видимыми даже на объектах с «гладким» затенением. Это связано с тем, как учитываются лучи АО, и этот учёт можно контролировать с помощью ползунка погрешности. Обратите внимание, что хотя такое может произойти даже с методами выборки квази-Монте-Карло, эффект гораздо более заметен с методом Равномерный разброс, ну и в любом случае, параметра Погрешность для квази-Монте-Карло нет.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

UV-сфера 24×24 с погрешностью 0.05 (по умолчанию). Обратите внимание на грани на поверхности сферы: они видны даже при включённом гладком затенении

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Повышение погрешности до 0.15 убирает артефакты гранёности

Adding Ambient Occlusion to Material

So I’ve baked an ambient occlusion map for my model, and want to apply it now.

Currently, I have a material, which I’ve added two textures to:

Following one of the tutorials on Blender Cloud, I set the Ambient Occlusion texture’s blend property to Multiply.

Problem is, this gives me a very dark result on the model, something like this: How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Not to surprising when the AO map looks like this: How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Those greys are dirtying my colors to around half their brightness when multiplied on top!

Is there a way to have the AO included, without darkening the entirety of my model? The other Blend options don’t seem to cause the AO map to affect the base colors at all, except for Value, but I have no idea what «Value» even does, and it still darkens the colors on the model anyways.

Is there a better way to bake the ambient occlusion that you use?

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

1 Answer 1

Multiplying AO over diffuse/albedo/base color is never «right», hence why it often gives that overly shadowed and dirty look. This is a pretty famous blog post by Zap Andersson on the subject that sums it up really well:

The tl:dr if you don’t feel like reading all that is that AO is not color information at all, it is a sort of fake indirect shadow pass.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

This way it will only shadow the ambient light (ex, the environment light in the world panel) and not the direct illumination from your real lights, which is already shadowed.

Of course, all this assumes you are actually using it as baked AO data. If you have AO enabled in the world settings, you don’t need baked AO at all, because you are calculating global AO at render time. Also, ambient occlusion bakes are useful for a lot of texturing tricks besides actual AO, since they tend to highlight contact points and crevices where dirt is likely to collect. If you’re using AO for dirt, you generally will end up blending it over the diffuse color (and possibly the spec/gloss/roughness/whatever-it-is-in-your-shader). This is because in that case, the AO is not shading data at all but is instead being used as color information. On a side note, if you are using AO maps for dirt, it helps to take the map into an image editor and use a brush to break up the even shading. Dirt doesn’t collect in nice gradients the way AO shading does. You may even want to pre-layer it over your color map at this point to save having to load an extra texture.

While we’re discussing AO, I should probably point out a pretty common misconception when using Cycles. Cycles does not NEED actual AO for anything, ever. Cycles does not have a true ambient light. The world light acts like one, but it’s actually a physical light at infinity in all directions rather than a classic CG ambient light. Cycles calculates indirect light «for real» and those diffuse rays are already occluded, even on secondary bounces.

Cycles has AO functions because they’re useful for all sorts of artistic things, but in most cases you should not use an actual AO map. If you want it for artistic texturing purposes it is almost always better to integrate it with your color map ahead of time rather than within the shader. But it’s not a shading thing you have to do, your GI is already properly shaded without AO.

Texture bake Ambient Occlusion maps for terrain in Blender

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Producing an Ambient Occlusion map for a terrain mesh, part or whole, through the use of Blenders Texture Bake system is usually a relatively straightforward procedure that differs very little from processing other types of object, a simple chair for example. Where there are differences, they typically relate to the physical size of both the mesh being baked and the texture being baked to, and whether or not the results are to be used within the context of an interactive environment where various optimisation’s and texture restrictions, in place to encourage efficient and speedy real-time usage, typically influence the outcome.

Contents
Resource
Archived Resources

The Basics of Texture Baking ^

As briefly mentioned in the introduction, through the use of Blenders «Texture Bake» rendering sub-system, particular aspects of a terrain mesh can be ‘translated’ into one or more ‘types’ of image that can be used to perform different functions within the context of real-time environments; a procedural material could be ‘made real‘ and then used to replace the very same data it was baked from. Similarly, the way structures, surfaces and objects affect lighting, how their interplay occludes it to create Object ‘shading‘ can also be rendered. This in essence, is what «Ambient Occlusion» is and why it’s useful to bake it.

Terrain & Basic Material Assignments ^

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Design note: Blender defaults to using UVW’s as the basis upon which textures are baked, ignoring other «Coordinates» types. However, to avoid problems elsewhere it’s generally a good idea to set this Mapping property to «UV» regardless.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Using Blender Generated Textures ^

Typically images assigned to Materials already exist as ‘bitmap’ assets, «*.tga» for example. For the purposes of texture baking this is not an absolute necessity because Blender has the ability to generate ‘procedural’ image data that can be assigned and used in much the same way as bitmaps.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

An alternative way to assign an «Image» to a Material is to use Blender to generate one. Click the «+ New» button and change the properties associated with the «New Image» slot, click «OK» and be returned back to «Texture» properties with an ‘image’ waiting to be assigned

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

With the «New Image» data created, make sure the «Texture» slot is selected in the «TextureList» and then click the «Browse Image to be linked» button, select the entry just created to assign it to the Material and watch for the ‘preview’ pane to update showing successful application

UVW Unwrapping & Textures ^

Design note: if using the «Shift+F10» shortcut switching between the main 3DView and UV/Image Editor, use «Shift+F5» to switch back (make sure the cursor is over the area when doing this else the shortcut will change the wrong viewport).

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

If not done already, changing one of the available viewport’s so the «UV/Image Editor» is visible, this will help the process of texture baking as both the UVW map and resulting bake will be seen during and immediately after completion

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Design note: terrain meshes usually result in rather awkward UVW map layouts that, whilst they can be edited, don’t or won’t really proffer up much better utilisation of space than originally calculated by Blender, so tweaking the layout without doing some major editing may not be of much use.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Terrain mesh UVW unwrapped and assigned a texture image ready for baking the Ambient Occlusion map. Note the above uses Blenders standard «Unwrap«, it’s generally typical that some minor adjustment can be made but there won’t necessarily be much more gained from doing so

UVW Maps & Generated Textures ^

UVW mapping generated images works in much the same way as using standard bitmap images, the only difference is their needing to be saved once applied. So, as per the above and using bitmaps, assign the texture to the terrains UVW’s in Edit mode by selecting the entry from the «Browse Image to be linked» list in the «UV/Image Editor» (in this instance «TerrainTex«), this will change the «Image» menu option to «Image*» [1] (the addition of an «*«) indicating the datablock has now been made real and needs to be saved. Click «Image*» and select «Save As Image» [2] from the available options.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Once the Blender generated ‘image’ is assigned to both the Material and mesh UVW map, making it real in the process, it’s best to save the image before continuing so there is a ‘fixed’ reference point for the asset prior to baking

Design note: once a generated image is saved it become real and can be used and manipulated in exactly the same way as if it were a pre-existing asset loaded into Blender and assigned to the mesh and Material.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Select a «loss-less» format to avoid compression artifacts that may cause problems later on when editing or using the image elsewhere in the process (when combined with the diffuse layer for example)

Baking the Terrains Ambient Occlusion ^

Design note: moving lights and other objects can of course be done at any point in time. It’s preferable however, that it should be done before baking anything.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Moving «Lamps» and unnecessary Objects to a different layer so they don’t interfere with the process and so the resulting ambient occlusion texture can be seen clearly over the mesh once its baked

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Click «Render» properties and scroll down to the very bottom of the list to the «Bake» sub-section (expand the options if not visible). Select «Ambient Occlusion» to access the appropriate settings.

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Saving the Baked Ambient Occlusion Map ^

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

In the «Browser» be sure to use a «loss-less» image format where-ever possible, even if the final output is to be a compressed JPG it is better to have an uncompressed source file to keep image ‘artifacts’ to a minimum

Texture Baking & Mesh Smoothing ^

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Using «Smooth» over the entire terrain produces ambient occlusion bakes that are more typical of this type of OBject, lit ostensibly through indirect background illumination

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

Side by side comparison of Ambient Occlusion maps baked with «Flat» (top) and «Smooth» (bottom) shading assigned to the terrain mesh

Conclusion ^

If the now saved Ambient Occlusion map is taken into an image editing application such as Corel Photo-Paint or GIMP, using one the the available image ‘blend mode’ filters, the shading attributed to the ambient occlusion image can be blended with an underlying terrain texture so that together, they produce a final ‘diffuse’ (or ‘colour map) image with better ‘depth’ than can be had separately. This new version can be reassigned to the terrain mesh as a ‘cheap’ alternative to more modern and costly techniques to shade a game asset (shown below).

How to add ambient occlusion texture blender. Смотреть фото How to add ambient occlusion texture blender. Смотреть картинку How to add ambient occlusion texture blender. Картинка про How to add ambient occlusion texture blender. Фото How to add ambient occlusion texture blender

In the following page, texture baking Ambient Occlusion for a terrain mesh is discussed in more detail.

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *