Viewport: Hair ribbon from geometry node have clipped ends #121020

Closed
opened 2024-04-24 13:06:12 +02:00 by Clément Foucault · 5 comments

This is visible in the microfacet hair orientation render test case.

This was observed on both M1 and M2 GPUs.

This is visible in the `microfacet hair orientation` render test case. This was observed on both M1 and M2 GPUs. ![](https://projects.blender.org/attachments/1af19e41-ac77-4318-8225-06c6c1ddc382)
Clément Foucault added this to the 4.2 LTS milestone 2024-04-24 13:06:12 +02:00

Will have a look into this

Will have a look into this

Currently a little tricky to see where this is going wrong. The backend seems to be rendering what it is given, although the geometry is doubling up on certain strands, when i'm unsure if it should. The strand buffer data input from the texture appears correct, but not sure if it is going wrong prematurely.

Is this definitely still working 100% correctly on all other platforms? (Or is the golden image possibly out of date).
I can see that the curves should have more segments, but this does not seem to be taking any of the topology optimization or emulation paths in the Metal backend, which was my first thought.

Currently a little tricky to see where this is going wrong. The backend seems to be rendering what it is given, although the geometry is doubling up on certain strands, when i'm unsure if it should. The strand buffer data input from the texture appears correct, but not sure if it is going wrong prematurely. Is this definitely still working 100% correctly on all other platforms? (Or is the golden image possibly out of date). I can see that the curves should have more segments, but this does not seem to be taking any of the topology optimization or emulation paths in the Metal backend, which was my first thought.
Author
Member

Is this definitely still working 100% correctly on all other platforms? (Or is the golden image possibly out of date).

It definitely is. I can also take a look at it later.

> Is this definitely still working 100% correctly on all other platforms? (Or is the golden image possibly out of date). It definitely is. I can also take a look at it later.

So this is happening on Metal, but I imagine the same issue would occur in OpenGL if use_strip_prims was also false in OpenGL.

source/blender/draw/intern/draw_cache_impl_curves.cc - static void calc_final_indices

bool use_strip_prims = (GPU_backend_get_type() != GPU_BACKEND_METAL);

it looks like the code is going wrong somewhere in this process, whether it is the triangle index buffer building in: source/blender/gpu/shaders/gpu_shader_index_2d_array_tris.glsl called by GPU_indexbuf_build_curves_on_device(..) or some other part of the logic, this is something i'm investigating.

From what I can see, using the triangle strip path looks visually correct in Metal. The Triangles path is non-essential, but certainly faster for rendering in the case of lots of small curves, due to better GPU scaling of non-restart-compatible primitive types.

So this is happening on Metal, but I imagine the same issue would occur in OpenGL if `use_strip_prims` was also false in OpenGL. `source/blender/draw/intern/draw_cache_impl_curves.cc - static void calc_final_indices` ``` bool use_strip_prims = (GPU_backend_get_type() != GPU_BACKEND_METAL); ``` it looks like the code is going wrong somewhere in this process, whether it is the triangle index buffer building in: `source/blender/gpu/shaders/gpu_shader_index_2d_array_tris.glsl` called by `GPU_indexbuf_build_curves_on_device(..)` or some other part of the logic, this is something i'm investigating. From what I can see, using the triangle strip path looks visually correct in Metal. The Triangles path is non-essential, but certainly faster for rendering in the case of lots of small curves, due to better GPU scaling of non-restart-compatible primitive types.

Looks like a small stride error during indexbuf building for triangles. PR has been submitted, but not sure if this fix would work universally for all cases. (As it may depend on if this code is used elsewhere and expected to behave in the current way).

Looks like a small stride error during indexbuf building for triangles. PR has been submitted, but not sure if this fix would work universally for all cases. (As it may depend on if this code is used elsewhere and expected to behave in the current way).
Hans Goudey added
Type
Bug
and removed
Type
Report
labels 2024-04-29 18:14:50 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-04-30 10:49:24 +02:00
Sign in to join this conversation.
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
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#121020
No description provided.