EEVEE-Next: Add horizon scan to raytracing module #114259
No reviewers
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#114259
Loading…
Reference in New Issue
No description provided.
Delete Branch "fclem/blender:eevee-next-horizon-gi"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
This uses the principles outlined in
Screen Space Indirect Lighting with Visibility Bitmask
to compute local and distant diffuse lighting.
This implements it inside the ray-tracing module as a fallback when the
surface is too rough. The threshold for blending between technique is
available to the user.
The implementation first setup a radiance buffer and a view normal
buffer. These buffer are tracing resolution as the lighting quality is
less important for rough surfaces. These buffers are necessary to avoid
re-projection on a per sample basis, and finding and rotating the
surface normal.
The processing phase scans the whole screen in 2 directions and outputs
local incomming lighting from neighbor pixels and the remaining
occlusion for everything that is outside the view.
The final steps filters the result of the previous phase while applying
the occlusion on the probe radiance to have an energy conserving mix.
Related #112979
TODOs
Tile base
Scalability
Prepass:
Ubiquitous
Future development:
1fdf2fb546
tob5539e32ae
@blender-bot build
@blender-bot build
The results for diffuse look really good.
And I'm happy to see the probes working again. :)
The only roadblock I see is that raytracing doesn't seem to be working at all for high roughness (>0.94).
The issue only seems to happen with the Principled BSDF (Diffuse and Glossy works fine).
I'm not sure about the reason.
@ -1844,0 +1848,4 @@
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
scene->eevee.reflection_options.screen_trace_max_roughness = 0.2f;
scene->eevee.refraction_options.screen_trace_max_roughness = 0.2f;
scene->eevee.diffuse_options.screen_trace_max_roughness = 0.2f;
I think 0.2 is way too low for reflections.
And I guess refractions once it's in use.
Does the
diffuse_options.screen_trace_max_roughness
have any actual effect?It is used when you set it to 1. The diffuse is considered to have roughness 1.
Since I couldn't make it work correctly with reflections, I increased this parameter to
0.5
which fades to0.7
which I think is a pretty good compromise for now.@ -60,7 +60,9 @@ void RayTraceModule::sync()
pass.shader_set(inst_.shaders.static_shader_get(RAY_TILE_CLASSIFY));
pass.bind_image("tile_mask_img", &tile_mask_tx_);
pass.bind_ssbo("ray_dispatch_buf", &ray_dispatch_buf_);
pass.bind_ssbo("denoise_dispatch_buf", &denoise_dispatch_buf_);
Maybe not for this PR, but I think this function as a whole (
RayTraceModule::sync
) could really benefit from comments explaining at a high level what each pass does and how they relate to each other.@ -19,3 +20,2 @@
{
/* TODO */
return 1.0;
return saturate(roughness * raytrace.roughness_mask_scale - raytrace.roughness_mask_bias);
It took me some effort to realize this is just a map_range.
Wouldn't make more sense to just do:
saturate(mask_scale * (roughness - mask_start))
?Note that I was looking at this because raytracing is not working for materials with high roughness, but the issue must be elsewhere.
This is made so that it is optimized as single MADD instruction. But I agree should have a map range structure/type + function that improves the semantic.
I tried to accommodate the AO + Visibility bitmask for global Illumination purpose of all BxDF.
However, this proved to not be as easy as it seemed. It works great for Lambertian diffuse BSDF but the sliced nature of the algorithm make it difficult to adjust to arbitrary shaped BxDF lobe. Here is some observations:
Slice sampling
Ideally, the slice directions should be chosen based on the BxDF and not a uniform direction around the view vector. This would avoid tracing in directions that have little or no influence. However this can result in non spatially uniform noise which can be harder to denoise.
Slice Weighting
The total weight of a slice depends on how much it crosses the BxDF lobe. Using the BxDF to weight individual samples works for contributing samples but we are missing what is the missing amount of energy in the cross section of the lobe. This missing contribution is what is called the far-field visibility. Each slice needs to be weighted accordingly to avoid low energy slices to dominate in the resulting mix (this is currently the major problem since each slice is only weighted by context.N_length which is correct for diffuse).
LTC integration
One solution would be to use LTC to modify the cosine lobe into the target BxDF. To do this, we should apply the LTC to the incoming light vectors (vL_front and vL_back). This would make use of all the visibility sectors efficiently as they should cover only the LTC representation of the BxDF.
The issue is, this changes the reference frame. The elevation angles need to be computed per BxDF (
acos_fast * 2 * bsdf
) after the light vectors LTC transform and many vectors need to be in local LTC space and duplicated (view vector, normal vector, light vector). TheN_length
weighting would no longer be the normal of the BxDF but the Z axis of the LTC projected to the slice plane in the LTC space.However, this doesn't change the fact that each sector is weighted incorrectly (using uniform weights). Using
horizon_scan_bitmask_to_visibility_cosine
for each sample should fix this issue.I can't reproduce this. Can you repro with the latest version?
@blender-bot build
Given how R&D the LTC solution is (there is no paper or known implementation), I will delay this to 4.1 or later.
I made sure that the current implementation passes the furnace test. So this patch is good to go for me.
Nope, not anymore. 👍