Grease Pencil View Port/render artifacts while camera movement in #63452

Closed
opened 2019-04-10 09:34:35 +02:00 by (Deleted) · 10 comments
(Deleted) commented 2019-04-10 09:34:35 +02:00 (Migrated from localhost:3001)

System Information
Operating system: Windows-10-10.0.14393 64 Bits
Graphics card: Intel(R) HD Graphics 4400 Intel 4.3.0 - Build 20.19.15.4835

Blender Version
Broken: version: 2.80 (sub 54), branch: master (modified), commit date: 2019-04-07 15:02, hash: 75f551faca
Worked: (optional)

Short description of error
In some cases like in the scene from attached blend file there seems to be a problem with rendering lines perpendicular to camera. As it can be seen the lines seem to appear merged at vanishing point even though they are far apart. this is happening both in view port and rendering.
Changed different parameters for camera line lens etc + also moved camera around but the problem still remains.

Render.png

ViewPort Glitches.gif

Test.blend

**System Information** Operating system: Windows-10-10.0.14393 64 Bits Graphics card: Intel(R) HD Graphics 4400 Intel 4.3.0 - Build 20.19.15.4835 **Blender Version** Broken: version: 2.80 (sub 54), branch: master (modified), commit date: 2019-04-07 15:02, hash: `75f551faca` Worked: (optional) **Short description of error** In some cases like in the scene from attached blend file there seems to be a problem with rendering lines perpendicular to camera. As it can be seen the lines seem to appear merged at vanishing point even though they are far apart. this is happening both in view port and rendering. Changed different parameters for camera line lens etc + also moved camera around but the problem still remains. ![Render.png](https://archive.blender.org/developer/F6926707/Render.png) ![ViewPort Glitches.gif](https://archive.blender.org/developer/F6926709/ViewPort_Glitches.gif) [Test.blend](https://archive.blender.org/developer/F6926710/Test.blend)
(Deleted) commented 2019-04-10 09:34:35 +02:00 (Migrated from localhost:3001)
Author

Added subscriber: @(Deleted)

Added subscriber: @(Deleted)

Added subscriber: @ChristopherAnderssarian

Added subscriber: @ChristopherAnderssarian

I get even worse glitching when animating the camera:

Output0001-0250.mkv

Test_modified.blend

Though I think this a known limitation... @antoniov?

I get even worse glitching when animating the camera: [Output0001-0250.mkv](https://archive.blender.org/developer/F6927070/Output0001-0250.mkv) [Test_modified.blend](https://archive.blender.org/developer/F6927075/Test_modified.blend) Though I think this a known limitation... @antoniov?

Added subscriber: @antoniov

Added subscriber: @antoniov

Added subscriber: @matc

Added subscriber: @matc

@pattamp In case you are looking for a workaround. When I subdivide the red stroke a few times, the problem seems to go away.

@pattamp In case you are looking for a workaround. When I subdivide the red stroke a few times, the problem seems to go away.
Antonio Vazquez was assigned by Sebastian Parborg 2019-04-11 10:59:14 +02:00

I found a possible fix for this. Not sure if it will cause other problems, but appears to be working in 3D view and when rendering.

diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
index 1ebb6797f63..aa38ff26a62 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
@@ -84,6 +84,9 @@ void main(void)
 	if (sp2.x < -area.x || sp2.x > area.x) return;
 	if (sp2.y < -area.y || sp2.y > area.y) return;
 
+	/* culling behind camera */
+	if (P1.w < 0 || P2.w < 0) return;
+
 	/* determine the direction of each of the 3 segments (previous, current, next) */
 	vec2 v0 = normalize(sp1 - sp0);
 	vec2 v1 = normalize(sp2 - sp1);
I found a possible fix for this. Not sure if it will cause other problems, but appears to be working in 3D view and when rendering. ``` diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl index 1ebb6797f63..aa38ff26a62 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl @@ -84,6 +84,9 @@ void main(void) if (sp2.x < -area.x || sp2.x > area.x) return; if (sp2.y < -area.y || sp2.y > area.y) return; + /* culling behind camera */ + if (P1.w < 0 || P2.w < 0) return; + /* determine the direction of each of the 3 segments (previous, current, next) */ vec2 v0 = normalize(sp1 - sp0); vec2 v1 = normalize(sp2 - sp1); ```

@matc It makes sense... I'm going to test with several files to see if nothing else is broken.

@matc It makes sense... I'm going to test with several files to see if nothing else is broken.
Author

This issue was referenced by 0ee23d0f5f

This issue was referenced by 0ee23d0f5f613c4418a3ab2b2c67d47b936350de

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' 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
4 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#63452
No description provided.