EEVEE Next: Hair & Curves #109833

Merged
Miguel Pozo merged 10 commits from pragma37/blender:pull-eevee-next-hair into main 2023-07-14 18:23:34 +02:00
Member

Finalize the hair & curves implementation for EEVEE Next.

Notable changes:

  • Ensure Hair particles have their own ResourceHandle and ObjectKey, so Motion Blur works correctly.
    (Note that the ObjectHandle and the ObjectKey is always created "on the fly" instead of being stored as DrawData, since it's not supported for particle system IDs).
  • The (unused) ObjectKey::use_particle_hair has been replaced by an integer sub_key, so multiple particle systems per object can be supported.
  • VelocityModule::step_object_sync now has 2 extra optional parameters for syncing Hair particle systems.
  • Update DRW_curves_update so it's safe to call it from "Next" engines.

Note:
I disabled the sampling.reset() call from step_object_sync, since is_deform is always true for objects with particle modifiers, and this causes the renderer to get stuck at sample 1.
I didn't fully remove it since I'm not sure if should be handled in some other way.

Finalize the hair & curves implementation for EEVEE Next. Notable changes: * Ensure Hair particles have their own `ResourceHandle` and `ObjectKey`, so Motion Blur works correctly. (Note that the `ObjectHandle` and the `ObjectKey` is always created "on the fly" instead of being stored as `DrawData`, since it's not supported for particle system `ID`s). * The (unused) `ObjectKey::use_particle_hair` has been replaced by an integer `sub_key`, so multiple particle systems per object can be supported. * `VelocityModule::step_object_sync` now has 2 extra optional parameters for syncing Hair particle systems. * Update `DRW_curves_update` so it's safe to call it from "Next" engines. Note: I disabled the `sampling.reset()` call from `step_object_sync`, since `is_deform` is always true for objects with particle modifiers, and this causes the renderer to get stuck at sample 1. I didn't fully remove it since I'm not sure if should be handled in some other way.
Miguel Pozo added the
Module
EEVEE & Viewport
label 2023-07-07 20:22:30 +02:00
Miguel Pozo added 4 commits 2023-07-07 20:22:39 +02:00
Miguel Pozo added this to the EEVEE & Viewport project 2023-07-07 20:22:47 +02:00
Miguel Pozo added 2 commits 2023-07-11 19:58:55 +02:00
Miguel Pozo added 1 commit 2023-07-12 17:09:28 +02:00
Miguel Pozo added 1 commit 2023-07-12 17:31:41 +02:00
Miguel Pozo changed title from WIP: EEVEE Next: Hair & Curves to EEVEE Next: Hair & Curves 2023-07-12 19:02:50 +02:00
Miguel Pozo requested review from Clément Foucault 2023-07-12 19:03:03 +02:00
Clément Foucault requested changes 2023-07-14 13:02:51 +02:00
Clément Foucault left a comment
Member

I agree with the changes. Just some small remarks but otherwise good to go.

I agree with the changes. Just some small remarks but otherwise good to go.
@ -43,2 +43,2 @@
/** If object uses particle system hair. */
bool use_particle_hair;
/** Used for particle system hair. */
bool sub_key_;

Supposed to be int I think.

Supposed to be int I think.
Author
Member

Ooops!

Ooops!
pragma37 marked this conversation as resolved
@ -174,3 +181,3 @@
/* TODO(@fclem): Reset sampling here? Should ultimately be covered by depsgraph update tags. */
inst_.sampling.reset();
// inst_.sampling.reset();

Add mention to why it is disabled for now.

Add mention to why it is disabled for now.
pragma37 marked this conversation as resolved
@ -37,13 +38,25 @@ void init_globals_mesh()
void init_globals_curves()
{
vec3 V = cameraVec(g_data.P);

Why does this has to move?

Why does this has to move?
Author
Member

Left-over from development.

Left-over from development.
pragma37 marked this conversation as resolved
@ -413,0 +416,4 @@
if (DRW_view_default_get() == nullptr) {
/* Create a dummy default view, it's not really used. */
DRW_view_default_set(DRW_view_create(
float4x4::identity().ptr(), float4x4::identity().ptr(), nullptr, nullptr, nullptr));

Isn't that dangerous to create a pointer to a temporary object?

Isn't that dangerous to create a pointer to a temporary object?
Author
Member

I don`t think so, the parameter scope is guaranteed to be valid until the function returns, and the matrix is copied down the line, the pointer itself is never stored.

I wasn't sure about the lifetime of the DRWView itself, but I saw other places following the same pattern, so I assumed it should be ok.

I don`t think so, the parameter scope is guaranteed to be valid until the function returns, and the matrix is copied down the line, the pointer itself is never stored. I wasn't sure about the lifetime of the DRWView itself, but I saw other places following the same pattern, so I assumed it should be ok.
fclem marked this conversation as resolved
Miguel Pozo added 2 commits 2023-07-14 17:22:07 +02:00
Clément Foucault approved these changes 2023-07-14 18:16:05 +02:00
Miguel Pozo merged commit 1a24b5f81f into main 2023-07-14 18:23:34 +02:00
Miguel Pozo deleted branch pull-eevee-next-hair 2023-07-14 18:23:35 +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
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#109833
No description provided.