Eevee-next: World Irradiance Caching #109516

Merged
Jeroen Bakker merged 9 commits from Jeroen-Bakker/blender:eevee-next-world-irradiance-cache-2 into main 2023-06-30 13:54:41 +02:00
Member

This PR adds world lighting to the irradiance cache and allows diffuse materials
to be lit by the world. The scene in the reference image is only lit by an environment
texture.

The reflection probe lib has been split into sampling the world probe and evaluating
the world probe. As evaluating the world probe requires to include more libraries and
data structures that aren't really needed for the irradiance cache shaders.

This PR adds world lighting to the irradiance cache and allows diffuse materials to be lit by the world. The scene in the reference image is only lit by an environment texture. The reflection probe lib has been split into sampling the world probe and evaluating the world probe. As evaluating the world probe requires to include more libraries and data structures that aren't really needed for the irradiance cache shaders.
Jeroen Bakker added this to the 4.0 milestone 2023-06-29 16:06:15 +02:00
Jeroen Bakker added the
Module
EEVEE & Viewport
label 2023-06-29 16:06:15 +02:00
Jeroen Bakker self-assigned this 2023-06-29 16:06:16 +02:00
Jeroen Bakker added 1 commit 2023-06-29 16:06:25 +02:00
Jeroen Bakker requested review from Clément Foucault 2023-06-29 16:06:32 +02:00
Jeroen Bakker added this to the EEVEE & Viewport project 2023-06-29 16:06:35 +02:00
Clément Foucault reviewed 2023-06-29 16:21:39 +02:00
@ -895,6 +895,11 @@ static char *glsl_patch_compute_get()
STR_CONCAT(patch, slen, "#version 430\n");
STR_CONCAT(patch, slen, "#extension GL_ARB_compute_shader :enable\n");
if (GLContext::texture_cube_map_array_support) {

Why is this part of the PR?

Why is this part of the PR?
Author
Member

Should be separated, but might also not be needed as reflection probe atlas packing works on 2d texture arrays.

Should be separated, but might also not be needed as reflection probe atlas packing works on 2d texture arrays.
Author
Member

I added #109546 that can land separately. This way we don't need to wait for the probe packing to land this change.

I added #109546 that can land separately. This way we don't need to wait for the probe packing to land this change.
Jeroen-Bakker marked this conversation as resolved
Jeroen Bakker added 1 commit 2023-06-30 07:40:24 +02:00
Jeroen Bakker added 1 commit 2023-06-30 08:18:08 +02:00
Jeroen Bakker changed title from WIP: Eevee-next: World Irradiance Caching to Eevee-next: World Irradiance Caching 2023-06-30 08:46:01 +02:00
Jeroen Bakker reviewed 2023-06-30 10:18:30 +02:00
@ -1,61 +1,6 @@
#pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl)
#pragma BLENDER_REQUIRE(cubemap_lib.glsl)
Author
Member

I think we should copy cubemap_lib to eevee_cubemap_lib. cubemap_lib is an Eevee-legacy glsl lib and expected to be removed

I think we should copy cubemap_lib to eevee_cubemap_lib. cubemap_lib is an Eevee-legacy glsl lib and expected to be removed
Jeroen-Bakker marked this conversation as resolved
Jeroen Bakker added 1 commit 2023-06-30 10:32:18 +02:00
Jeroen Bakker added 1 commit 2023-06-30 10:33:43 +02:00
Clément Foucault requested changes 2023-06-30 11:34:36 +02:00
@ -49,3 +49,3 @@
PassSimple surfel_light_propagate_ps_ = {"LightPropagate"};
/** Capture surfel lighting to irradiance samples. */
PassSimple irradiance_capture_ps_ = {"IrradianceCapture"};
PassSimple irradiance_capture_ps_[2] = {{"IrradianceCaptureWithWorld"}, {"IrradianceCapture"}};

Why do you split with and without world? You should capture world for every bounce.

Why do you split with and without world? You should capture world for every bounce.
Jeroen-Bakker marked this conversation as resolved
Jeroen Bakker added 1 commit 2023-06-30 11:41:06 +02:00
Jeroen Bakker added 1 commit 2023-06-30 11:55:42 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
eda46ff1c9
Only propagate light in the first sample
Author
Member

@blender-bot build

@blender-bot build
Jeroen Bakker added 1 commit 2023-06-30 12:49:40 +02:00
Clément Foucault requested changes 2023-06-30 12:55:31 +02:00
@ -90,3 +96,2 @@
else {
/* TODO(fclem): Sky radiance. */
irradiance_capture(sky_L, vec3(0.0), sh);
vec3 world_radiance = irradiance_sky_sample(sky_L);

sky_L is inverted in both cases here.

`sky_L` is inverted in both cases here.
Jeroen-Bakker marked this conversation as resolved
Jeroen Bakker added 1 commit 2023-06-30 13:06:22 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
68b0edc4d2
Invert capture direction.
Author
Member

@blender-bot build

@blender-bot build
Clément Foucault approved these changes 2023-06-30 13:08:01 +02:00
Jeroen Bakker merged commit 91c3fd7a3b into main 2023-06-30 13:54:41 +02:00
Jeroen Bakker deleted branch eevee-next-world-irradiance-cache-2 2023-06-30 13:54:42 +02: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
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 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.

Reference: blender/blender#109516
No description provided.