Skip to content

Commit 6c0bd95

Browse files
authored
Merge pull request #10996 from LunaCapra/specular-occlusion
Add specular occlusion documentation to StandardMaterial3D tutorial
2 parents 7fb22e7 + 659cdae commit 6c0bd95

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed
3.36 KB
Binary file not shown.
Binary file not shown.

tutorials/3d/standard_material_3d.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ Disable Fog
325325

326326
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).
327327

328+
Disable Specular Occlusion
329+
~~~~~~~~~~~~~~~~~~~~~~~~~~
330+
331+
Makes the object not have its reflections reduced where they would usually be occluded.
332+
328333
Vertex Color
329334
------------
330335

@@ -417,6 +422,43 @@ and wider compatibility.
417422
popular engines) can be found
418423
`here <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details>`__.
419424

425+
Bent normal map
426+
---------------
427+
428+
A bent normal map describes the average direction of ambient lighting. Unlike a
429+
regular normal map, this is used to improve how a material reacts to lighting
430+
rather than add surface detail.
431+
432+
This is achieved in two ways:
433+
434+
* Indirect diffuse lighting is made to match global illumination more closely.
435+
* If specular occlusion is enabled, it is calculated using the bent normals and
436+
ambient occlusion instead of just from ambient light.
437+
This includes screen-space ambient occlusion (SSAO) and other sources of
438+
ambient occlusion.
439+
440+
.. image:: img/spatial_material_bentnormals.webp
441+
442+
Godot only uses the red and green channels of a bent normal map for better
443+
compression and wider compatibility.
444+
445+
When creating a bent normal map, there are three things required for it to
446+
work correctly in Godot:
447+
448+
* A **cosine distribution** of rays has to be used when baking.
449+
* The texture must be created in **tangent space**.
450+
* The bent normal map needs to use the X+, Y+, and Z+ coordinates, this is
451+
known as OpenGL style. If you've imported a material made to be used with
452+
another engine it may be DirectX style, in which case the bent normal map
453+
needs to be converted so its Y axis is flipped. This can be achieved by
454+
setting the green channel under the **Channel Remap** section to
455+
**Inverted Green** in the import dock.
456+
457+
.. note::
458+
459+
A bent normal map is different from a regular normal map. The two are not
460+
interchangeable.
461+
420462
Rim
421463
---
422464

0 commit comments

Comments
 (0)