Nodes: Broken noodle display with reroutes #106929

Closed
opened 2023-04-14 08:01:09 +02:00 by Sun Kim · 8 comments
Contributor

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.61

Blender Version
Broken: version: 3.6.0 Alpha, branch: main, commit date: 2023-04-12 22:05, hash: d48939f103c0
Worked: version: 3.6.0 Alpha, branch: main, commit date: 2023-03-14 01:53, hash: 84b66c5a9c47

Caused by something between 2.6 2023-03-14 01:53, hash: 84b66c5a9c47 and 3.6 2023-03-20 14:55 16fbadde363c.

Also can confirm in 3.5.0.

Short description of error
In some of hair nodes, node noodles look broken with reroutes.

BrokenNoodles2.png

BrokenNoodles.gif

The glitch simply goes away if I move the reroutes.

Exact steps for others to reproduce the error
I don't know how to replicate this from scratch, only found in hair node groups.

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.61 **Blender Version** Broken: version: 3.6.0 Alpha, branch: main, commit date: 2023-04-12 22:05, hash: `d48939f103c0` Worked: version: 3.6.0 Alpha, branch: main, commit date: 2023-03-14 01:53, hash: `84b66c5a9c47` Caused by something between 2.6 2023-03-14 01:53, hash: `84b66c5a9c47` and 3.6 2023-03-20 14:55 `16fbadde363c`. Also can confirm in 3.5.0. **Short description of error** In some of hair nodes, node noodles look broken with reroutes. ![BrokenNoodles2.png](/attachments/756f2ec8-2476-4580-835f-b9b456f35e85) ![BrokenNoodles.gif](/attachments/6ca34974-918a-4274-834d-3866b6b62e91) The glitch simply goes away if I move the reroutes. **Exact steps for others to reproduce the error** I don't know how to replicate this from scratch, only found in hair node groups.
Sun Kim added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-04-14 08:01:09 +02:00
Member

Thanks for the report. Can confirm

Thanks for the report. Can confirm
Member

Did bisecting two times and it pointed to: 740c9204cc
not sure if its correct responsible commit.

Did bisecting two times and it pointed to: 740c9204cc40565caf9026610145bc3a4ca5b75d not sure if its correct responsible commit.
Member
CC @bonj CC @HooglyBoogly
Member

@PratikPB2123, @lichtwerk I don't think that commit is at fault. :)

This has been a problem for quite a while when sockets align as reported in #89282. Originally this was only a problem for vertically aligning sockets but since 9a86255da8 it also happens to horizontally aligning sockets.

What happens is that for aligning sockets the handles of the bezier curve are coincident with the end points, and as a result these last segments of the curve can't be drawn. That is why this is only visible when the sockets are far enough apart that the last segment of the curve is longer than the size of the node socket.

It seemed like someone wanted to tackle this as their first issue, but it's been a while and I can make a fix over the weekend if it's urgent.

@PratikPB2123, @lichtwerk I don't think that commit is at fault. :) This has been a problem for quite a while when sockets align as reported in #89282. Originally this was only a problem for vertically aligning sockets but since 9a86255da8 it also happens to horizontally aligning sockets. What happens is that for aligning sockets the handles of the bezier curve are coincident with the end points, and as a result these last segments of the curve can't be drawn. That is why this is only visible when the sockets are far enough apart that the last segment of the curve is longer than the size of the node socket. It seemed like someone wanted to tackle this as their first issue, but it's been a while and I can make a fix over the weekend if it's urgent.
Iliya Katushenock added
Priority
Normal
and removed
Priority
High
labels 2023-04-14 13:23:08 +02:00

This is definitely not a recent regression. And this can only be achieved by deliberately making such long links. So it would be nice if it gets fixed, but I don't think it's urgent.

This is definitely not a recent regression. And this can only be achieved by deliberately making such long links. So it would be nice if it gets fixed, but I don't think it's urgent.
Contributor

Hi @lone_noel, @mod_moder

I found out what the problem is.
In the vertex shader the tangent is a zero vector for the endpoints.
When using normalize(tangent) the tangent becomes an invalid value.

When excluding the normalization for zero vectors the result is like in the image.
There is still an issue that the first vertex is not expanded and is rendered like a triangle, but I see that for vertical nodelinks it was already a problem also if the handles are not overlapping with the endpoints.

Should I create a PR with this first fix or should I try to fix the problem with the thickness of the endpoints?

Hi @lone_noel, @mod_moder I found out what the problem is. In the vertex shader the tangent is a zero vector for the endpoints. When using `normalize(tangent)` the tangent becomes an invalid value. When excluding the normalization for zero vectors the result is like in the image. There is still an issue that the first vertex is not expanded and is rendered like a triangle, but I see that for vertical nodelinks it was already a problem also if the handles are not overlapping with the endpoints. Should I create a PR with this first fix or should I try to fix the problem with the thickness of the endpoints?
Member

Hey, thanks for looking into it @merotosc!

Ideally the issue would be fixed completely. I can think of two ways to approach this:

  1. Use a good heuristic to replace the invalid tangent in the shader.
    The shape of node links is pretty constrained (symmetric, the „bezier handles“ are always horizontal) so you might be able to get away with replacing the tangent with something like normalize(P3 - P0) when the tangent is zero. I hope there isn't an edge case I'm missing here.

  2. Avoid creating node links that cause issues.
    The control polygon of the bezier curve is calculated in calculate_inner_link_bezier_points. Maybe you could make it so the inner points don’t overlap the end points exactly, which would sidestep the issue.

If there are no issues with it, I’d gravitate towards option 1. Not sure what would be preferred by the core team, though.
A PR would be very appreciated either way!

Hey, thanks for looking into it @merotosc! Ideally the issue would be fixed completely. I can think of two ways to approach this: 1. Use a good heuristic to replace the invalid tangent in the shader. The shape of node links is pretty constrained (symmetric, the „bezier handles“ are always horizontal) so you might be able to get away with replacing the tangent with something like `normalize(P3 - P0)` when the tangent is zero. I hope there isn't an edge case I'm missing here. 2. Avoid creating node links that cause issues. The control polygon of the bezier curve is calculated in `calculate_inner_link_bezier_points`. Maybe you could make it so the inner points don’t overlap the end points exactly, which would sidestep the issue. If there are no issues with it, I’d gravitate towards option 1. Not sure what would be preferred by the core team, though. A PR would be very appreciated either way!
Contributor

Yes, you are right @lone_noel. Using normalize(P3 - P0) already solves it.

Now there is only the issue for the vertical nodelinks that don't overlap because the tangent is always (+/-1, 0) at endpoints since the handles are always horizontally aligned with the nodes.
But I can't think of an easy approximation for the tangent on the endpoints.

I now created a PR with this fixes: #107636

Yes, you are right @lone_noel. Using `normalize(P3 - P0)` already solves it. Now there is only the issue for the vertical nodelinks that don't overlap because the tangent is always (+/-1, 0) at endpoints since the handles are always horizontally aligned with the nodes. But I can't think of an easy approximation for the tangent on the endpoints. I now created a PR with this fixes: #107636
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-05-12 20:35:33 +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
6 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#106929
No description provided.