Page MenuHome

Grease Pencil View Port/render artifacts while camera movement in
Closed, ResolvedPublic


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

Blender Version
Broken: version: 2.80 (sub 54), branch: master (modified), commit date: 2019-04-07 15:02, hash: rB75f551facaf0
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.

Event Timeline

I get even worse glitching when animating the camera:

Though I think this a known limitation... @Antonio Vazquez (antoniov)?

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

Sebastian Parborg (zeddb) triaged this task as Confirmed, Medium priority.

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 (matc) It makes sense... I'm going to test with several files to see if nothing else is broken.