Skip to content

Add specular occlusion documentation to StandardMaterial3D tutorial #10996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified tutorials/3d/img/spatial_material1.webp
Binary file not shown.
Binary file not shown.
42 changes: 42 additions & 0 deletions tutorials/3d/standard_material_3d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ Disable Fog

Makes the object unaffected by depth-based or volumetric fog. This is useful for particles or other additively blended materials that would otherwise show the shape of the mesh (even in places where it would be invisible without the fog).

Disable Specular Occlusion
~~~~~~~~~~~~~~~~~~~~~~~~~~

Makes the object not have its reflections reduced where they would usually be occluded.

Vertex Color
------------

Expand Down Expand Up @@ -414,6 +419,43 @@ and wider compatibility.
popular engines) can be found
`here <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details>`__.

Bent normal map
---------------

A bent normal map describes the average direction of ambient lighting. Unlike a
regular normal map, this is used to improve how a material reacts to lighting
rather than add surface detail.

This is achieved in two ways:

* Indirect diffuse lighting is made to match global illumination more closely.
* If specular occlusion is enabled, it is calculated using the bent normals and
ambient occlusion instead of just from ambient light.
This includes screen-space ambient occlusion (SSAO) and other sources of
ambient occlusion.

.. image:: img/spatial_material_bentnormals.webp

Godot only uses the red and green channels of a bent normal map for better
compression and wider compatibility.

When creating a bent normal map, there are three things required for it to
work correctly in Godot:

* A **cosine distribution** of rays has to be used when baking.
* The texture must be created in **tangent space**.
* The bent normal map needs to use the X+, Y+, and Z+ coordinates, this is
known as OpenGL style. If you've imported a material made to be used with
another engine it may be DirectX style, in which case the bent normal map
needs to be converted so its Y axis is flipped. This can be achieved by
setting the green channel under the **Channel Remap** section to
**Inverted Green** in the import dock.

.. note::

A bent normal map is different from a regular normal map. The two are not
interchangeable.

Rim
---

Expand Down
Loading