Wireframe overlay clipping issues #72547

Closed
opened 2019-12-18 15:33:18 +01:00 by Julien Kaspar · 10 comments
Member

System Information
Operating system: Linux-4.15.0-72-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: Quadro GP100/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.50

Blender Version
Broken: version: 2.82 (sub 6), branch: master, commit date: 2019-12-18 12:31, hash: 409d3f4880
Worked: 2.81

Short description of error
The wireframe drawing as an overlay is not negatively influenced by the clip start in the viewport.
When in Orthographic view the clipping of the wireframes will stay consistent but may be not ideal.
In past versions of Blender the wireframe clipping stayed consistent no matter the clip end/start settings.

2019-12-18 15-25-37.mp4

**System Information** Operating system: Linux-4.15.0-72-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: Quadro GP100/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.50 **Blender Version** Broken: version: 2.82 (sub 6), branch: master, commit date: 2019-12-18 12:31, hash: `409d3f4880` Worked: 2.81 **Short description of error** The wireframe drawing as an overlay is not negatively influenced by the clip start in the viewport. When in Orthographic view the clipping of the wireframes will stay consistent but may be not ideal. In past versions of Blender the wireframe clipping stayed consistent no matter the clip end/start settings. [2019-12-18 15-25-37.mp4](https://archive.blender.org/developer/F8232184/2019-12-18_15-25-37.mp4)
Author
Member

Added subscriber: @JulienKaspar

Added subscriber: @JulienKaspar
Jeroen Bakker was assigned by Julien Kaspar 2019-12-18 15:33:33 +01:00
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

@Jeroen-Bakker: will you take care of this?

@Jeroen-Bakker: will you take care of this?
Member

@lichtwerk, Yes I asked Julien to create this issue and assign it to me IRL.

@lichtwerk, Yes I asked Julien to create this issue and assign it to me IRL.

Added subscriber: @Dogway

Added subscriber: @Dogway
Member

Added subscriber: @fclem

Added subscriber: @fclem
Member

Seems like when in orthographic mode the gl_position.z is negative.
Perspective mode
image.png

Orthographic mode
image.png

Seems like the vertex shader is shifting the lines a bit to the camera. but in case for orthographic this shift moves the lines to the other side of the camera making render on top of other lines.
I suppose that the wireframe_vert.glsl needs to be adjusted for this.

P1198: #72547

diff --git a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
index 21f8bcf1791..a124721362c 100644
--- a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
@@ -120,7 +120,9 @@ void main()
   gl_Position.xy += wofs.xy * sizeViewportInv.xy * gl_Position.w;
 
   /* Push the vertex towards the camera. Helps a bit. */
-  gl_Position.z -= facing_ratio * curvature * 1e-4;
+  if (is_persp) {
+    gl_Position.z -= facing_ratio * curvature * 1e-4;
+  }
 
   /* Convert to screen position [0..sizeVp]. */
   edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;

helps but we might want to do a better curvation. Assigning to @fclem if he has other ideas how to solve this?

Seems like when in orthographic mode the gl_position.z is negative. Perspective mode ![image.png](https://archive.blender.org/developer/F8251709/image.png) Orthographic mode ![image.png](https://archive.blender.org/developer/F8251707/image.png) Seems like the vertex shader is shifting the lines a bit to the camera. but in case for orthographic this shift moves the lines to the other side of the camera making render on top of other lines. I suppose that the `wireframe_vert.glsl` needs to be adjusted for this. [P1198: #72547](https://archive.blender.org/developer/P1198.txt) ```diff diff --git a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl index 21f8bcf1791..a124721362c 100644 --- a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl @@ -120,7 +120,9 @@ void main() gl_Position.xy += wofs.xy * sizeViewportInv.xy * gl_Position.w; /* Push the vertex towards the camera. Helps a bit. */ - gl_Position.z -= facing_ratio * curvature * 1e-4; + if (is_persp) { + gl_Position.z -= facing_ratio * curvature * 1e-4; + } /* Convert to screen position [0..sizeVp]. */ edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy; ``` helps but we might want to do a better curvation. Assigning to @fclem if he has other ideas how to solve this?
Jeroen Bakker removed their assignment 2019-12-30 12:49:29 +01:00
Clément Foucault was assigned by Jeroen Bakker 2019-12-30 12:49:29 +01:00
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker

This issue was referenced by fca069a705

This issue was referenced by fca069a705318f58aece433318556fb06c99e842

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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#72547
No description provided.