EEVEE Next: Point Clouds #109832

Merged
Miguel Pozo merged 13 commits from pragma37/blender:eevee-next-point-clouds into main 2023-07-14 17:23:36 +02:00
Member

Add support for point cloud rendering in EEVEE Next.
It also updates point_cloud_sub_pass_setup to retrieve texture based attributes,
since that's the way they're actually meant to be used.

  • I had to include common_pointcloud_lib into eevee_attributes_lib, which is not super great and some workarounds were required. Maybe attribute loading functions could be moved to their respective vertex/fragment shaders?
Add support for point cloud rendering in EEVEE Next. It also updates `point_cloud_sub_pass_setup` to retrieve texture based attributes, since that's the way they're actually meant to be used. - I had to include `common_pointcloud_lib` into `eevee_attributes_lib`, which is not super great and some workarounds were required. Maybe attribute loading functions could be moved to their respective vertex/fragment shaders?
Miguel Pozo added the
Module
EEVEE & Viewport
label 2023-07-07 20:14:05 +02:00
Miguel Pozo added 7 commits 2023-07-07 20:14:19 +02:00
Miguel Pozo added this to the EEVEE & Viewport project 2023-07-07 20:14:34 +02:00
Miguel Pozo requested review from Clément Foucault 2023-07-10 15:35:39 +02:00
Miguel Pozo added 2 commits 2023-07-10 18:32:09 +02:00
Clément Foucault requested changes 2023-07-13 23:57:12 +02:00
Clément Foucault left a comment
Member

Looks good! Was not able to test on Metal because of another bug but compilation of tests shaders passes.

I would just like to remove the complexity of the vertex shader like suggested. Otherwise it's good to go.

Looks good! Was not able to test on Metal because of another bug but compilation of tests shaders passes. I would just like to remove the complexity of the vertex shader like suggested. Otherwise it's good to go.
@ -382,3 +383,2 @@
{
/* Only mesh and curves support vertex displacement for now. */
if (ELEM(geometry_type, MAT_GEOM_MESH, MAT_GEOM_CURVES, MAT_GEOM_GPENCIL)) {
if (ELEM(

At this point, just test for MAT_GEOM_VOLUME and MAT_GEOM_WORLD.

At this point, just test for MAT_GEOM_VOLUME and MAT_GEOM_WORLD.
pragma37 marked this conversation as resolved
@ -0,0 +21,4 @@
mat3 facing_mat;
{
/* Same logic as pointcloud_get_facing_matrix(), but ensuring we use the actual camera matrices

I guess the issue you had is that shadow map geometry was not matching the camera one producing self shadowing.
Instead of making the shadow camera dependent (that does not work with shadow map caching), I suggest to add a bias in the shadow map shader for point cloud. From my calculation, a bias equal to the point radius should be enough to remove any self shadowing.

This should remove the need for all this logic.

I guess the issue you had is that shadow map geometry was not matching the camera one producing self shadowing. Instead of making the shadow camera dependent (that does not work with shadow map caching), I suggest to add a bias in the shadow map shader for point cloud. From my calculation, a bias equal to the point radius should be enough to remove any self shadowing. This should remove the need for all this logic.
pragma37 marked this conversation as resolved
@ -41,0 +41,4 @@
GPU_SHADER_INTERFACE_INFO(eevee_surf_point_cloud_iface, "point_cloud_interp")
.smooth(Type::FLOAT, "radius")
.smooth(Type::VEC3, "position")
.flat(Type::INT, "ID");

no uppercase.

no uppercase.
pragma37 marked this conversation as resolved
@ -41,0 +48,4 @@
.define("MAT_GEOM_POINT_CLOUD")
.vertex_source("eevee_geom_point_cloud_vert.glsl")
.vertex_out(eevee_surf_point_cloud_iface)
.define("pointRadius", "point_cloud_interp.radius")

Add todo to remove after old EEVEE is removed.

Add todo to remove after old EEVEE is removed.
pragma37 marked this conversation as resolved
@ -155,6 +155,12 @@ Quaternion to_axis_angle(AxisAngle axis_angle)
return quat;
}
Quaternion from_vector_delta(vec3 from, vec3 to)

Rename to rotation_between.

Rename to `rotation_between`.
pragma37 marked this conversation as resolved
@ -181,6 +187,13 @@ AxisAngle to_axis_angle(EulerXYZ eul)
return to_axis_angle(to_quaternion(eul));
}
vec3 rotate(vec3 vector, Quaternion rotation)

Rename to transform_point. In general, try to follow BLI_math_rotation.hh for naming conventions.

Rename to `transform_point`. In general, try to follow `BLI_math_rotation.hh` for naming conventions.
pragma37 marked this conversation as resolved
Miguel Pozo added 4 commits 2023-07-14 16:38:55 +02:00
Clément Foucault approved these changes 2023-07-14 17:18:53 +02:00
Miguel Pozo merged commit e48d0c3cda into main 2023-07-14 17:23:36 +02:00
Miguel Pozo deleted branch eevee-next-point-clouds 2023-07-14 17:23:37 +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#109832
No description provided.