Workbench Next: Hair and Curves support #109456
No reviewers
Labels
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 project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#109456
Loading…
Reference in New Issue
No description provided.
Delete Branch "pragma37/blender:pull-workbench-next-curves"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add Hair and Curves support to the new Draw Manager. The
sub_pass_setup
functions bind the required data to an already created sub-pass and return the batches needed for drawing.Add Hair and Curves rendering to Workbench Next:
Notes:
Looks good and quite safe. So will accept once my comments are addressed.
@ -135,3 +136,3 @@
}
if (ob->type == OB_MESH && ob->modifiers.first != nullptr) {
bool render_ob_data = DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF;
Prefer using
is_
anddo_
prefix for boolean to describe what state they describe. In this case it is the object visibility sois_object_data_visible
.@ -138,0 +138,4 @@
bool render_ob_data = DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF;
render_ob_data = render_ob_data && (ob->dt >= OB_SOLID || DRW_state_is_scene_render());
if (!(ob->base_flag & BASE_FROM_DUPLI)) {
Split this block to a separate function called
Instance::object_visibility_get
.volume_ps.object_sync_modifier
is called from this block of code.It would be pretty bad to hide that inside a seemingly unrelated helper function, IMO.
Oops I missed that. Forget my comment then.
@ -370,0 +383,4 @@
PassMain::Sub &pass = get_mesh_pass(ob_ref, mat.is_transparent())
.get_subpass(eGeometryType::CURVES, image, sampler_state, iuser)
.sub(ob_ref.object->id.name);
This is pretty volatile!
ob_ref.object
could be the same pointer for many duplis instances. It could also be allocated on the stack for the duration of the sync process. It is not advisable to reference any of the data inside an object.@ -107,0 +103,4 @@
return *passes_[int(geometry_type)][int(eShaderType::MATERIAL)];
}
void MeshPass::draw(ObjectRef &ref,
Remove this. It would make it easier to understand if there is less functions to a class that do almost the same thing.
@ -540,0 +630,4 @@
sub_ps.bind_ubo("drw_curves", curves_infos);
sub_ps.push_constant("hairStrandsRes", &curves_cache->final[subdiv].strands_res, 1);
I would be tempted to ask for bundling these into one UBO for each Curve object, but that's better left to another PR.
Yep, there was a TODO on the original
draw_hair
shader info too.However, as long as we need to bind a separate
hairPointBuffer
for each call, I don't think is going to make a huge difference?It could make a difference for some backends depending on how we update that. Also it would clean the global namespace.