This page has been translated automatically.
Программирование
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

AmbientMapper

AmbientMapper is used to generate ambient occlusion maps for low-poly meshes. It calculates self-shadowing from omni directional "sky light" as well as occlusion and attenuation of light by nearby geometry, and bakes it into the texture to adds realistic shading to the model.

AmbientMapper module

Usage

To create an ambient occlusion map, do the following:

  1. Load a low-poly mesh for which ambient occlusion will be calculated by clicking Load Low.
  2. Load a reference high-poly mesh by clicking Load High. This step is optional. If a high-poly mesh is loaded, it will be used to calculate an ambient occlusion for the low-poly mesh.
  3. Switch to Ambient Mapin one of the viewing panes.
  4. If necessary, load a cage mesh by clicking Load Cage.
  5. If necessary, load an environment mesh by clicking Load Env.
  6. Set ambient occlusion options at the right side of the window.
  7. Click Runto start calculation.
  8. When ambient map calculation is completed, click Save.

Warning
AmbientMapper is designed to work only within the first UV tile region (texture coordinates [0;1]). Multiple UV tiles are ignored.

Display Modes

AmbientMapper has two viewing panes. The display mode can be switched in the drop-down list in the upper left corner of each pane:

  • Mesh to display a low-poly mesh.
  • Normal Map to display the loaded normal map applied to the low-poly mesh. If there are no normal maps loaded, an empty one-channel (red) map will be displayed by default.
  • Ambient Map to display the generated ambient occlusion map applied to the to the low-poly mesh.
  • TexCoord 0 to display an ambient map generated basing on the first UV set.
  • TexCoord 1 to display an ambient map generated basing on the second UV set.
  • Cage Mesh to display a cage mesh.
  • High Mesh to display a high-poly mesh.

File Options

The set of file options present at the right side of the window:

Load  Low Load a low-poly mesh for which an ambient occlusion map will be created.

Low-poly mesh

Low-poly Mesh
Notice
You can also load a low-poly mesh by pressing Ctrl+O.
Load  High Load a high-poly mesh basing on which an ambient occlusion map will be baked.

High-Poly mesh

High-poly mesh
Notice
You can also load a high-poly mesh by pressing Ctrl+H.
Load  Cage Load a cage mesh. This mesh allows cleaner baking of the ambient occlusion map.

Without a cage, the rays are cast from the low-poly mesh to the high-poly one (in both directions along the normals of a low-poly). It is done to determine what point of a high-poly mesh (full geometry of which allows to calculate proper ambient occlusion) corresponds to a low-poly mesh point. Whatever point is intersected first, it gets to be baked into the map. However, if there are complex geometry details in the high-poly model or overlapping surfaces, the first met point may not be a proper one! Instead of baking an outer surface, an underneath one that is closest to the low-poly mesh will be baked into a map.

A cage allows to avoid such situations. When loaded, the rays are traced from it rather then from a low-poly.

  • A cage mesh is usually a low-poly mesh slightly bloated to be bigger in size and cover both a high-poly and a low-poly meshes (see the illustration below). Though even a simple box would do for a cage.
  • It should not necessarily cover all volume of the meshes. The cage can be partial - only above such surfaces where complex geometry details are found.

Cage mesh
Cage mesh
A cage encompasses both a high and a low-poly model (viewed in the MeshViewer)
For example, if we set a cage above a surface with rivets, we will get correct ambient occlusion of all details. Without a cage, there can appear visual artifacts.

AO without the Cage mesh AO with the Cage mesh
AO without the Cage mesh. Details were not baked correctly.
AO with the Cage mesh. All rivets are properly occluded.
Notice
You can also load the cage mesh by pressing Ctrl+C.
Load  Env Load an environment mesh. This option allows you to load additional geometry that will occlude light for the source mesh and shadow it. For environment mesh itself ambient occlusion is not calculated.

Environment mesh

Environment mesh
For example, if an occluded mesh is a part of some construction, the latter can be is loaded as an environment mesh. Here you can see that the mesh is adjacent to a bigger framework. With this option, the mesh backside will be shadowed.

Occluded and Environment meshes from the back AO with the Environment mesh
Occluded and Environment meshes from the back
AO with the Environment mesh
Notice
You can also load the environment mesh by pressing Ctrl+E.
Normal Map Normal map allows to calculate ambient occlusion without a high-poly mesh. It uses normals from the map to calculate how the light would fall onto the mesh.
  • If both high-poly and a normal mesh are present, it creates a more correct ambient occlusion map with softer edges.

AO using only a Normal map

AO calculated using only a normal map
Notice
You can also load the environment mesh by pressing Ctrl+N.
Reload  All Reload all loaded resources.
Notice
You can also reload resources by pressing Ctrl+R.
Run Perform the ambient occlusion calculations. The result applied to the model can be seen in the Ambient Map mode.
Save Save the calculated ambient occlusion map into the texture. See supported formats into which the texture can be saved.
  • DXT1 compression - if a texture is saved into .dds format, it can be automatically compressed using this option. If another format is specified, the option will be ignored.
Notice
You can also save the mesh by pressing Ctrl+S.

Visualization Options

The set of visualization options:

Info Display information about the mesh that is currently in the viewport. Such data is shown as number of surfaces, vertices and triangles.
Notice
You can also enable the option by pressing I.
Compass Toggle an XYZ compass in the upper right corner of the viewport.
Notice
You can also enable the option by pressing C.
Triangles Toggles showing a base grid plane.
Notice
You can also enable the option by pressing T.

Ambient Occlusion Options

The set of ambient occlusion options:

Size Size of the output ambient map.
AA Anti-aliasing mode for the output ambient map. If used, it consumes additional memory.
  • The higher the value, the softer and more blurred the ambient map will be.

AO without AA AO with AA
AO without anti-aliasing
AO with anti-aliasing
TexCoord UV channel to store the ambient map in. To store the map in the second UV channel, the model should have been exported accordingly.
Samples The number of sampling light rays traced from each point of the mesh to calculate ambient occlusion. If a ray hits some geometry, it meas that the light is occluded and therefore the tested point should be shadowed. The more rays return occluded, the darker the resulting shadowing will be.
  • The higher the value, the less grainy the ambient map will be and the longer time calculating it would take.

Low value of Samples High value of Samples
Samples = 16
Samples = 1024
Radius Distance to trace the light rays to. To be exact, this is a radius for the hemisphere, within which the number of sampling light rays are traced in random directions.
  • Small radius may be used to achieve sharp and dark occlusion of details.
  • Big radius may be used to get the overall occlusion of the mesh. There will be no distinct details. The process of calculating AO will also take longer time.

Small Radius Big Radius
Radius = 0.1
Radius = 2
Power The power of ambient occlusion term. The higher the value, the brighter the resulting ambient occlusion will be.

Low value of Power High value of Power
Power = 0.1
Power = 3
Extrude Extrusion in pixels. This option adds colored pixels around the contour of each UV shell. The color value is simply copied from the nearby pixel. It allows to get rid of possible darkening where seams meet.
  • The lower the size of the ambient map, the more visible darkening along the seams is. Increasing Extrusion parameter may help in this case.

Extrusion

Extrusion

No pixel extrusion With pixel extrusion
Extrusion = 0 pixels
Extrusion = 3 pixels

Supported File Formats

Supported formats of geometry data:

  • Unigine mesh (.mesh)
  • Unigine skinned mesh (.smesh)
  • Wavefront (.obj)
  • COLLADA (.dae)

Supported formats of textures:

  • Targa (.tga)
  • Portable Network Graphics (.png)
  • JPEG (.jpg)
  • Photoshop Document (.psd)
  • Direct Draw Surface (.dds)
  • Portable Pixmap (.ppm)
  • Portable Graymap (.pgm)
  • High Dynamic Range (.hdr)
  • Silicon Graphics Image (.sgi)

Hot Keys

Last update: 03.07.2017
Build: ()