EEVEE Next: Volumes: Lighting integration improvements #110809

Merged
Clément Foucault merged 10 commits from pragma37/blender:pull-eevee-next-volumes-2-cleanup into main 2023-09-06 14:36:06 +02:00
Member

Add the features missing from #107176

  • Irradiance integration.
  • Self-shadows.
  • Receive shadows from shadow maps.

Shadow tagging works by iterating all the froxels in a compute shader and tagging the exact same position that will be sampled by the volume scatter shader.
Froxels that are fully transmissive, have no scattering, or are behind opaque geometry, are skipped.

It also adds a LoD bias parameter for shadow tagging, driven by the volumetric tile size.
This works for punctual shadows, but directional lights would need a way to support re-direction between levels at sampling time, which is out of the scope of this PR.

Add the features missing from #107176 * Irradiance integration. * Self-shadows. * Receive shadows from shadow maps. Shadow tagging works by iterating all the froxels in a compute shader and tagging the exact same position that will be sampled by the volume scatter shader. Froxels that are fully transmissive, have no scattering, or are behind opaque geometry, are skipped. It also adds a LoD bias parameter for shadow tagging, driven by the volumetric tile size. This works for punctual shadows, but directional lights would need a way to support re-direction between levels at sampling time, which is out of the scope of this PR.
Miguel Pozo added 4 commits 2023-08-04 19:23:26 +02:00
Miguel Pozo added the
Module
EEVEE & Viewport
label 2023-08-04 19:23:37 +02:00
Miguel Pozo added this to the EEVEE & Viewport project 2023-08-04 19:23:43 +02:00
Miguel Pozo requested review from Clément Foucault 2023-08-04 19:23:52 +02:00
Clément Foucault requested changes 2023-08-16 18:01:35 +02:00
@ -6,6 +6,7 @@
* - irradiance_atlas_tx
*/
#pragma BLENDER_REQUIRE(gpu_shader_codegen_lib.glsl)

Not sure what this has to do with the patch.

Not sure what this has to do with the patch.
Author
Member

It's simply that gpu_shader_codegen_lib is required by eevee_lightprobe_eval_lib, since it needs the Closure structs declared.
I think it's best if files handle their own dependencies, unless there's a good reason not to do so.
If that's the case the import could be moved to eevee_volume_scatter_comp.

It's simply that `gpu_shader_codegen_lib` is required by `eevee_lightprobe_eval_lib`, since it needs the Closure structs declared. I think it's best if files handle their own dependencies, unless there's a good reason not to do so. If that's the case the import could be moved to `eevee_volume_scatter_comp`.

Ok fine then.

Ok fine then.
fclem marked this conversation as resolved
@ -82,6 +82,10 @@ mat4x4 shadow_load_normal_matrix(LightData light)
* match the surface. */
float shadow_slope_bias_get(vec2 atlas_size, LightData light, vec3 lNg, vec3 lP, vec2 uv, uint lod)
{
if (lNg == vec3(0)) {

Prefer a define. Also avoid these vector comparison. They are not portable. Use is_equal instead.

Prefer a define. Also avoid these vector comparison. They are not portable. Use `is_equal` instead.
pragma37 marked this conversation as resolved
@ -122,3 +116,3 @@
#if 0 && defined(VOLUME_SHADOW)
vec4 l_vector = vec4(L * l_dist, l_dist);
# if 0

Always add comment on #if 0 block to state why it is commented.

Always add comment on `#if 0` block to state why it is commented.
pragma37 marked this conversation as resolved
@ -142,2 +136,3 @@
L = l_vector.xyz / volumes_info_buf.shadow_steps;
if (ld.type == LIGHT_SUN) {
if (ld.type <= LIGHT_SUN_ORTHO) {

use is_sun_light

use `is_sun_light`
pragma37 marked this conversation as resolved
Miguel Pozo added 2 commits 2023-08-21 16:31:05 +02:00
Miguel Pozo added 1 commit 2023-09-05 16:00:36 +02:00
Miguel Pozo added 2 commits 2023-09-05 17:06:59 +02:00
Clément Foucault approved these changes 2023-09-06 14:17:08 +02:00
Clément Foucault added 1 commit 2023-09-06 14:25:33 +02:00
Clément Foucault merged commit fc08f220bf into main 2023-09-06 14:36:06 +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
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 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#110809
No description provided.