EEVEE-Next: Planar Probe Pipeline #113203

Merged
Clément Foucault merged 13 commits from Jeroen-Bakker/blender:eevee/planar-reflection-probes into main 2023-10-08 19:50:08 +02:00
Member

This PR is contains the initial capture pipeline for planar probes.

It requires work to generate the correct view to capture and to include
the result during ray tracing. These will be developed in a separate PR.

This PR detects if a planar probe is active in the scene. If this is
the case the planar probe pipeline will be activated. During rendering
this is done by querying the depsgraph, during viewport drawing this
is done during sync. If an planar probe is detected and the pipeline
wasn't activated. The pipeline will be activated and the sampling
will be reset to ensure the pipeline is filled with all objects.

Per object the user can set the visibility of the object in planar
reflections.
image

For a reflection plane the resolution and clipping offset can be set.
EDIT: Resolution option was removed because too complex to
implement with the little time we have at the moment.
image

Related to #112966

This PR is contains the initial capture pipeline for planar probes. It requires work to generate the correct view to capture and to include the result during ray tracing. These will be developed in a separate PR. This PR detects if a planar probe is active in the scene. If this is the case the planar probe pipeline will be activated. During rendering this is done by querying the depsgraph, during viewport drawing this is done during sync. If an planar probe is detected and the pipeline wasn't activated. The pipeline will be activated and the sampling will be reset to ensure the pipeline is filled with all objects. Per object the user can set the visibility of the object in planar reflections. ![image](/attachments/fcfb40f9-f174-491c-bfba-e7f00f49aa1c) For a reflection plane the resolution and clipping offset can be set. EDIT: Resolution option was removed because too complex to implement with the little time we have at the moment. ![image](/attachments/e42ad9ce-8af8-45d1-aa3a-630db1901ad3) Related to #112966
Jeroen Bakker added this to the 4.1 milestone 2023-10-03 14:24:10 +02:00
Jeroen Bakker added the
Module
EEVEE & Viewport
label 2023-10-03 14:24:10 +02:00
Jeroen Bakker self-assigned this 2023-10-03 14:24:11 +02:00
Jeroen Bakker added 1 commit 2023-10-03 14:24:24 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
bc061462a0
EEVEE-Next: Planar Probe Pipeline
This PR is contains the initial capture pipeline for planar probes.

It requires work to generate the correct view to capture and to include
the result during ray tracing.
Jeroen Bakker requested review from Clément Foucault 2023-10-03 14:24:46 +02:00
Jeroen Bakker added this to the EEVEE & Viewport project 2023-10-03 14:24:50 +02:00
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR113203) when ready.
Jeroen Bakker added 3 commits 2023-10-05 08:32:51 +02:00
Jeroen Bakker added 1 commit 2023-10-05 09:17:40 +02:00
Clément Foucault requested changes 2023-10-05 11:23:17 +02:00
Clément Foucault left a comment
Member

Overall is good. Only small changes.

Overall is good. Only small changes.
@ -0,0 +37,4 @@
PlanarProbe &probe = find_or_insert(ob_handle);
probe.is_probe_used = true;
probe.resolution = 1 << light_probe->resolution;

This shouldn't be a power of 2. But a screen percentage. Should be fine to change the meaning of it in the RNA for planar.

This shouldn't be a power of 2. But a screen percentage. Should be fine to change the meaning of it in the RNA for planar.
Author
Member

I added its own attribute, otherwise bpy API will get confusing.

I added its own attribute, otherwise bpy API will get confusing.
Jeroen-Bakker marked this conversation as resolved
@ -0,0 +52,4 @@
{
const int64_t num_probes = probes_.size();
if (textures_.size() != num_probes) {
Texture default_texture("PlanarProbe");

What's this?

What's this?
Jeroen-Bakker marked this conversation as resolved
@ -0,0 +60,4 @@
for (PlanarProbe &probe : probes_.values()) {
probe.texture_index = texture_index++;
Texture &texture = textures_[probe.texture_index];
texture.ensure_2d(GPU_RGBA16F,

Use R11G11B10 for radiance and a separate DEPTH32F for depth.
I think you should add a Framebuffer too (unconfigured here).

Use R11G11B10 for radiance and a separate DEPTH32F for depth. I think you should add a `Framebuffer` too (unconfigured here).
Jeroen-Bakker marked this conversation as resolved
@ -0,0 +68,4 @@
PlanarProbe &PlanarProbeModule::find_or_insert(ObjectHandle &ob_handle)
{
PlanarProbe &planar_probe = probes_.lookup_or_add_cb(ob_handle.object_key.hash(), [this]() {

capturing this?

capturing `this`?
Jeroen-Bakker marked this conversation as resolved
@ -0,0 +69,4 @@
PlanarProbe &PlanarProbeModule::find_or_insert(ObjectHandle &ob_handle)
{
PlanarProbe &planar_probe = probes_.lookup_or_add_cb(ob_handle.object_key.hash(), [this]() {
PlanarProbe probe;

Use lookup_or_add_default instead

Use `lookup_or_add_default` instead
Jeroen-Bakker marked this conversation as resolved
@ -163,3 +166,1 @@
if (do_probe_sync) {
geometry_call(material.probe_prepass.sub_pass, geom, res_handle);
geometry_call(material.probe_shading.sub_pass, geom, res_handle);
if (do_reflection_probe_sync) {

Add a TODO that we should not compile the shader and create a subpass if the object has no visibiility for these passes.

Add a TODO that we should not compile the shader and create a subpass if the object has no visibiility for these passes.
Jeroen-Bakker marked this conversation as resolved
Jeroen Bakker force-pushed eevee/planar-reflection-probes from 7d0159e20d to a4b7da60bd 2023-10-05 13:01:28 +02:00 Compare
Jeroen Bakker reviewed 2023-10-05 13:01:40 +02:00
@ -0,0 +48,4 @@
probe.is_probe_used = true;
probe.resolution = 1 << light_probe->resolution;
probe.object_mat = float4x4(ob->object_to_world);
probe.clipping_distances = float2(light_probe->clipsta, light_probe->clipend);
Author
Member

use float clip_distance (only start)

use float clip_distance (only start)
Jeroen-Bakker marked this conversation as resolved
Jeroen Bakker added 1 commit 2023-10-06 11:44:15 +02:00
Clément Foucault added 1 commit 2023-10-06 21:11:18 +02:00
Clément Foucault added the
Interest
EEVEE
label 2023-10-08 09:32:36 +02:00
Clément Foucault added 2 commits 2023-10-08 16:05:45 +02:00
9b79fb24e1 Merge branch 'main' into eevee/planar-reflection-probes
# Conflicts:
#	source/blender/draw/engines/eevee_next/eevee_reflection_probes.cc
Clément Foucault added 1 commit 2023-10-08 16:45:25 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
0a5414e0be
Remove resolution scaling
It is not supported for the first implementation
as this turns out to be more complex that anticipated.
Clément Foucault approved these changes 2023-10-08 16:45:29 +02:00

@blender-bot build

@blender-bot build
Clément Foucault merged commit 61b463d5e4 into main 2023-10-08 19:50:08 +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
3 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#113203
No description provided.