EEVEE-Next: Make Ambient Occlusion Pass use Horizon Scan #114150

Merged
Clément Foucault merged 24 commits from fclem/blender:eevee-next-horizon-scan into main 2023-11-02 19:22:11 +01:00

This adds a new way of computing occlusion using visibility bitmask. To
make it more algorithm agnostic, we name it horizon scan.
This cleans-up / simplify the code compared to the Horizon based solution.
There is no more trickery for fading influence of distant samples which
makes the result match cycles closer.

This introduces a new thickness option. Maintaining it relatively low
makes it possible to avoid over occlusion because of in front geometry.
Making it too low will cause under occlusion.

Related #112979

Image
Cycles Capture d’écran du 2023-10-25 21-47-18
EEVEE (Legacy) Capture d’écran du 2023-10-25 21-48-59
EEVEE (New) Capture d’écran du 2023-10-25 21-48-51
This adds a new way of computing occlusion using visibility bitmask. To make it more algorithm agnostic, we name it horizon scan. This cleans-up / simplify the code compared to the Horizon based solution. There is no more trickery for fading influence of distant samples which makes the result match cycles closer. This introduces a new thickness option. Maintaining it relatively low makes it possible to avoid over occlusion because of in front geometry. Making it too low will cause under occlusion. Related #112979 | | Image | | -------- | -------- | | Cycles | ![Capture d’écran du 2023-10-25 21-47-18](/attachments/177b23e9-5404-44bd-a395-09690c8963de)| | EEVEE (Legacy) | ![Capture d’écran du 2023-10-25 21-48-59](/attachments/aa2c8f4f-62de-4190-a6a8-29335b14907f)| | EEVEE (New)|![Capture d’écran du 2023-10-25 21-48-51](/attachments/99c1191c-1fd2-4c3e-8ac9-4c854ff284c5) |
Clément Foucault added this to the 4.1 milestone 2023-10-25 14:25:46 +02:00
Clément Foucault added the
Interest
EEVEE
Module
EEVEE & Viewport
labels 2023-10-25 14:25:46 +02:00
Clément Foucault added 12 commits 2023-10-25 14:25:59 +02:00
Clément Foucault added 3 commits 2023-10-25 17:31:59 +02:00
Clément Foucault added 4 commits 2023-10-25 21:01:25 +02:00
Clément Foucault added 1 commit 2023-10-25 21:28:01 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
2c2f531c3c
Fix wrong Ray type
Clément Foucault changed title from WIP: EEVEE-Next: Make Ambient Occlusion Pass use Horizon Scan to EEVEE-Next: Make Ambient Occlusion Pass use Horizon Scan 2023-10-25 22:01:46 +02:00
Author
Member

@blender-bot build

@blender-bot build
Clément Foucault requested review from Miguel Pozo 2023-10-25 22:02:11 +02:00
Clément Foucault added 2 commits 2023-10-25 22:12:47 +02:00
Miguel Pozo requested changes 2023-10-26 17:52:48 +02:00
Miguel Pozo left a comment
Member

I've only skimmed the actual scan implementation, but the results look fine, so I'd assume it's fine. XD

You have not removed the previous implementation, and the AO node still uses it.
Is this intended?

I've only skimmed the actual scan implementation, but the results look fine, so I'd assume it's fine. XD You have not removed the previous implementation, and the AO node still uses it. Is this intended?
@ -194,3 +194,3 @@
col = layout.column()
col.prop(props, "gtao_quality", text="Precision")
col.prop(props, "horizon_quality", text="Precision")
Member

Since 80a8368b88, there's no way to set the AO distance from the UI!

Also, I don't think Horizon Scan is a great name for the user side.
Could these settings get merged with the Screen Tracing ones?

Since 80a8368b88, there's no way to set the AO distance from the UI! Also, I don't think *Horizon Scan* is a great name for the user side. Could these settings get merged with the *Screen Tracing* ones?
Author
Member

Since 80a8368b88, there's no way to set the AO distance from the UI!

It has been move to the view layer panel since it is only related to the occlusion pass. There is a todo to move the parameter to the view-layer datablock itself.

Could these settings get merged with the Screen Tracing ones?

I am also thinking of this. But that would be part of another PR.

> Since 80a8368b88, there's no way to set the AO distance from the UI! It has been move to the view layer panel since it is only related to the occlusion pass. There is a todo to move the parameter to the view-layer datablock itself. > Could these settings get merged with the Screen Tracing ones? I am also thinking of this. But that would be part of another PR.
fclem marked this conversation as resolved
@ -36,1 +45,3 @@
data, texel, V, N, Ng, 0.0, visibility, unused_visibility_error_out, unused_bent_normal_out);
/* We can have some float imprecision because of the weighted accumulation. */
if (ambient_occlusion.r >= 0.98) {
ambient_occlusion = vec3(1.0);
Member

I haven't really noticed any visual issues.
But maybe it might be better to scale it uniformly instead?

ambient_occlusion = saturate(ambient_occlusion / 0.98)
I haven't really noticed any visual issues. But maybe it might be better to scale it uniformly instead? ``` ambient_occlusion = saturate(ambient_occlusion / 0.98) ```
pragma37 marked this conversation as resolved
@ -0,0 +57,4 @@
* distribution in `horizon_scan_angles_to_bitmask()` but that requires more computation per
* samples. The quality difference does not justify it currently. */
#if 0 /* Reference. */
Member

IIRC, some preprocessors freak out when there's a directive and a comment in the same line.

IIRC, some preprocessors freak out when there's a directive and a comment in the same line.
Author
Member

The search regex (#if).*(\/\*) over all glsl files finds 32 matches. So I'm pretty sure it works.

The search regex `(#if).*(\/\*)` over all glsl files finds 32 matches. So I'm pretty sure it works.
fclem marked this conversation as resolved
Clément Foucault added 1 commit 2023-11-02 18:44:42 +01:00
Author
Member

@blender-bot build

@blender-bot build
Clément Foucault added 1 commit 2023-11-02 18:45:57 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
8a8a30cc5b
Merge branch 'main' into eevee-next-horizon-scan
# Conflicts:
#	source/blender/blenloader/intern/versioning_400.cc
Clément Foucault requested review from Miguel Pozo 2023-11-02 18:46:07 +01:00
Author
Member

The AO node is to be handled in another patch. Currently, inverted normals are not working. So this should be fixed before this replace the AO node.

The AO node is to be handled in another patch. Currently, inverted normals are not working. So this should be fixed before this replace the AO node.
Miguel Pozo approved these changes 2023-11-02 18:49:27 +01:00
Clément Foucault merged commit 0684b68eb4 into main 2023-11-02 19:22:11 +01:00
Clément Foucault deleted branch eevee-next-horizon-scan 2023-11-02 19:22:13 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#114150
No description provided.