EEVEE-Next: Extract Spherical Harmonics from World #110110
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#110110
Loading…
Reference in New Issue
No description provided.
Delete Branch "Jeroen-Bakker/blender:eevee-next/environment-spherical-harmonics-extraction"
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?
This PR adds diffuse light from environment to the scene without having an
irradiance volume in the scene.
It does this by extracting the sperical harmonics from the world probe and
store it in the irradiance brick that is reserved for world diffuse light
in the irradiance cache.
This also fixes that selecting an LookDev HDRI didn't update the diffuse
light.
Known Issues
to flickering and instability in the spherical harmonics. This is an
issue that should be solved in a separate patch as it is already visible
in main
manually for the expected results (but this also disabled GI). In the future
this will be done automatically or we will add a solution to separate the
world diffuse light from the irradiance cache so we can update it on the fly.
WIP: Eevee-next: Extract Spherical Harmonics Cooefs from World Probeto Eevee-next: Extract Spherical Harmonics Cooefs from World@ -38,6 +38,7 @@ struct ReflectionProbe {
bool do_update_data = false;
/* Should the area in the probes_tx_ be updated? */
bool do_render = false;
bool do_update_irradiance = false;
Would call it
do_world_irradiance_update
.@ -167,6 +170,7 @@ class ReflectionProbeModule {
std::optional<ReflectionProbeUpdateInfo> update_info_pop(ReflectionProbe::Type probe_type);
void remap_to_octahedral_projection(uint64_t object_key);
void update_probes_texture_mipmaps();
void update_irradiance(uint64_t object_key);
This is confusing. Why would it take an object_key if that is only for updating the world?
@ -0,0 +1,84 @@
/* Shader to extract spherical harmonics cooefs from octahedral mapped reflection probe. */
/* TODO(jbakker): Use larger dispatch size and atomic add. */
Remove TODO
@ -0,0 +37,4 @@
barrier();
/* Determine the LOD to sample. We locate mipmap level that contains the 64x64 subdivision what
I don't think this comment brings any clarification to what's happening. Either make it more descriptive or remove it.
@ -0,0 +54,4 @@
vec2 rand = fract(hammersley_2d(sample_index + sample_offset, total_samples));
vec3 direction = sample_sphere(rand);
vec4 light = reflection_probes_sample(direction, layer_mipmap, probe_data);
spherical_harmonics_encode_signal_sample(
I wouldn't put a early return even if that's after the barrier.
@ -105,0 +107,4 @@
float omega = rand.y * 2.0 * M_PI;
float cos_theta = rand.x * 2.0 - 1.0;
float sin_theta = safe_sqrt(1.0 - cos_theta * cos_theta);
return vec3(sin_theta * vec2(cosf(omega), sinf(omega)), cos_theta);
cos
&sin
.cosf
is for C++ and it is a define in our GLSL .Eevee-next: Extract Spherical Harmonics Cooefs from Worldto Eevee-next: Extract Spherical Harmonics from WorldEevee-next: Extract Spherical Harmonics from Worldto EEVEE-Next: Extract Spherical Harmonics from World@blender-bot build