EEVEE Next: GI surfels debug display #105802

Merged
Miguel Pozo merged 6 commits from pragma37/blender:pull-eevee-next-surfels into main 2023-03-16 14:14:44 +01:00
Member

Add a surfels debug pass to aid with the GI implementation development.

Add a surfels debug pass to aid with the GI implementation development.
Miguel Pozo added 2 commits 2023-03-15 17:54:11 +01:00
18d943e9b0 EEVEE Next: GI surfels debug display
First step to help with the GI implementation development.
033b55da2a Use vec3 for surfels positions and normals
Avoid the casting when using them
Miguel Pozo added this to the EEVEE & Viewport project 2023-03-15 17:54:18 +01:00
Miguel Pozo requested review from Clément Foucault 2023-03-15 17:54:26 +01:00
Clément Foucault requested changes 2023-03-15 18:19:07 +01:00
@ -142,6 +142,7 @@ set(SRC
engines/eevee_next/eevee_depth_of_field.cc
engines/eevee_next/eevee_engine.cc
engines/eevee_next/eevee_film.cc
engines/eevee_next/eevee_gi.cc

Rename to eevee_irradiance_cache.cc.

Rename to `eevee_irradiance_cache.cc`.
pragma37 marked this conversation as resolved
@ -448,6 +450,8 @@ set(GLSL_SRC
engines/eevee_next/shaders/eevee_geom_gpencil_vert.glsl
engines/eevee_next/shaders/eevee_geom_mesh_vert.glsl
engines/eevee_next/shaders/eevee_geom_world_vert.glsl
engines/eevee_next/shaders/eevee_gi_debug_surfels_vert.glsl

Drop the gi_ bit as this could be used for other cases.

Drop the `gi_` bit as this could be used for other cases.
pragma37 marked this conversation as resolved
@ -119,6 +119,7 @@
#define LIGHT_BUF_SLOT 1
#define LIGHT_ZBIN_BUF_SLOT 2
#define LIGHT_TILE_BUF_SLOT 3
#define GI_SURFEL_BUF_SLOT 4

This isn't a buffer that needs to be bound to multiple shader (yet). So I would remove the static index.

This isn't a buffer that needs to be bound to multiple shader (yet). So I would remove the static index.
pragma37 marked this conversation as resolved
@ -0,0 +28,4 @@
void GI::init()
{
if (debug_surfels_sh_ == nullptr) {
debug_surfels_sh_ = GPU_shader_create_from_info_name("eevee_gi_debug_surfels");

Replace by inst_.shaders.static_shader_get(DEBUG_SURFEL).

Replace by `inst_.shaders.static_shader_get(DEBUG_SURFEL)`.
pragma37 marked this conversation as resolved
@ -0,0 +8,4 @@
class Instance;
class GI {

class IrradianceCache

`class IrradianceCache`
pragma37 marked this conversation as resolved
@ -51,3 +55,4 @@
/**
* Show tiles depending on their status.
*/

Blank line.

Blank line.
pragma37 marked this conversation as resolved
@ -822,2 +827,4 @@
/** \} */
/* -------------------------------------------------------------------- */
/** \name GI

\name Debug

`\name Debug`
pragma37 marked this conversation as resolved
@ -824,0 +830,4 @@
/** \name GI
* \{ */
struct Surfel {

Rename to DebugSurfel

Rename to `DebugSurfel`
pragma37 marked this conversation as resolved
@ -824,0 +831,4 @@
* \{ */
struct Surfel {
float3 position;

Use packed_float3 if you do that.

Use `packed_float3` if you do that.
pragma37 marked this conversation as resolved
@ -0,0 +6,4 @@
surfel_index = gl_InstanceID;
Surfel surfel = surfels_buf[surfel_index];
const vec3 verts[4] = vec3[4](vec3(-1, 1, 0), vec3(-1, -1, 0), vec3(1, 1, 0), vec3(1, -1, 0));

Prefer using a switch for compatibility with Metal.

Prefer using a switch for compatibility with Metal.
pragma37 marked this conversation as resolved
@ -303,7 +303,6 @@ if(WITH_METAL_BACKEND)
list(APPEND SRC ${METAL_SRC})
endif()

What happened in this file? feels like clang-format version mismatch.

What happened in this file? feels like `clang-format` version mismatch.
pragma37 marked this conversation as resolved
Miguel Pozo reviewed 2023-03-15 20:46:42 +01:00
@ -824,0 +830,4 @@
/** \name GI
* \{ */
struct Surfel {
Author
Member

So the idea would be to eventually have a Surfel and a DebugSurfel and make the copy/conversion before rendering the debug visualization?

So the idea would be to eventually have a Surfel and a DebugSurfel and make the copy/conversion before rendering the debug visualization?
pragma37 marked this conversation as resolved
Miguel Pozo reviewed 2023-03-15 20:48:41 +01:00
@ -119,6 +119,7 @@
#define LIGHT_BUF_SLOT 1
#define LIGHT_ZBIN_BUF_SLOT 2
#define LIGHT_TILE_BUF_SLOT 3
#define GI_SURFEL_BUF_SLOT 4
Author
Member

I was more worried about replacing an already binded buffer.
Isn't that an issue?

I was more worried about replacing an already binded buffer. Isn't that an issue?
pragma37 marked this conversation as resolved
Author
Member

Not sure what's going on with Gitea.
When I reply to a review comment it sends me directly to the review process.

Not sure what's going on with Gitea. When I reply to a review comment it sends me directly to the review process.
Clément Foucault reviewed 2023-03-16 08:41:46 +01:00
@ -119,6 +119,7 @@
#define LIGHT_BUF_SLOT 1
#define LIGHT_ZBIN_BUF_SLOT 2
#define LIGHT_TILE_BUF_SLOT 3
#define GI_SURFEL_BUF_SLOT 4

No because this only for the display pass. Every resource needed should be bound inside a pass.
If it needs to be bound to an existing pass, the slot need to be chosen manually on a per shader basis to avoid conflict.
Not sure if my explanation is clear. But anyway, just remove that define.

No because this only for the display pass. Every resource needed should be bound inside a pass. If it needs to be bound to an existing pass, the slot need to be chosen manually on a per shader basis to avoid conflict. Not sure if my explanation is clear. But anyway, just remove that define.
pragma37 marked this conversation as resolved
@ -824,0 +830,4 @@
/** \name GI
* \{ */
struct Surfel {

Yes. I'm thinking we could reuse it for raytracing debugging.

Yes. I'm thinking we could reuse it for raytracing debugging.
pragma37 marked this conversation as resolved
Miguel Pozo added 1 commit 2023-03-16 13:58:47 +01:00
Miguel Pozo force-pushed pull-eevee-next-surfels from 6aa3c90de1 to e823874aa1 2023-03-16 14:04:20 +01:00 Compare
Clément Foucault approved these changes 2023-03-16 14:12:43 +01:00
Miguel Pozo merged commit 8bb411ad1a into main 2023-03-16 14:14:44 +01:00
Miguel Pozo deleted branch pull-eevee-next-surfels 2023-03-16 14:14:45 +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 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#105802
No description provided.