Page MenuHome

Blender 2.80 Grease Pencil surface offset by viewport distance instead of geometry surface
Closed, ArchivedPublic

Description

System Information
Operating system: 10.14.3 (18D109)
Graphics card: NVIDIA GeForce GT 750M 2048 MB

Blender Version
Broken: Blender 2.80, 2019-02-21 23:40, 9541ce2c261b Branch blender2.7

and originally found in:

Blender 2.80, 2019-02-08 04:22, 46ac288a9306 Branch blender2.7

Short description of error
Grease pencil strokes don't offset by the surface of the geometry. They are offset based on viewport distance at the time of the initial stroke.

Exact steps for others to reproduce the error

  1. Shift + A to add Ico Sphere
  2. Shift + A to add Grease Pencil (blank)
  3. Change to Draw mode
  4. Change Stroke Placement to Surface
  5. Change Surface Offset to 0.00020 (> 0.0000)
  6. Draw on geometry surface close-up in view
  7. Zoom out
  8. Draw on geometry surface
  9. Rotate view to see varied stroke placement distances (instead of all strokes offset on the geometry the same offset distance).

Details

Type
Bug

Related Objects

Event Timeline

Surface offset is not designed as an absolute distance to mesh, but as a factor over the surface, this is the reason you don't see all strokes at the same distance.

Hi Antonio,

Thank you for responding! I appreciate it.

I'm confused by 'factor over the surface'. My understanding is the lines/strokes drawn on the surface of the mesh are offset by the value set in the Offset 'parameter'.

If I draw over a mesh and zoom in to add more detail, the offset value reflected on new lines is different, so the lines are no longer the same distance to the surface. Is this intentional?

If I draw over a mesh, without zooming in, I'm not sure how I can check to make sure the offset of the stroke thickness remains above the surface of the mesh because any viewport adjustment appears to influence the line consistency over the surface based on the zoom distance.

Thanks!

I know what you mean, but this offset was not designed for that. Really is a small "gap" factor to avoid mesh penetration.

When you draw a stroke, there are some limitations when get the distance to put the stroke over the mesh face. Sometimes, if there are some penetration, you can use this parameter, but never was designed to work as the offset of the Shrinkwrap modifier.

If you want to keep all the strokes over the sphere, maybe, you could duplicate the sphere, scale it...draw on the surface with offset 0 and finally, remove the duplicated sphere.

I see. My experience is the strokes always penetrate the mesh face, which affects the appearance of the stroke. To counter this, I thought I could use the offset to slightly offset the distance to the mesh face.

If you see in the screencast, the stroke on the left has a large gap between the mesh despite having the same offset number. The only difference is that I zoomed in/out.

If this is expected and not a bug, how can I draw on a surface consistently? Should I assume I can't adjust my viewport position.

Thank you!

Sebastian Parborg (zeddb) closed this task as Archived.
Sebastian Parborg (zeddb) claimed this task.

As stated, you can try to duplicate the mesh and scale it to the desired offset and draw on that one and then delete it when you are done.

I'm not sure the issue is understood. The offset number is not consistent. The grease pencil's distance from the surface (offset) of the mesh changes after zooming/trucking in-and-out.

When a user draws on a mesh (e.g. a default sphere) and zooms in/out, draws again, then the offset relative value changes based on the view distance from the mesh. The Offset value parameter/option never changed:

Duplicating the mesh and scaling it to match the Stroke's offset doesn't work because the distance is different due to the grease pencil surface offset inconsistencies.

There's no way to draw on a surface consistently if the viewport's zoom distance changes. This continues through to the b5d87f802806 version.

I believe the issue here is that for GP to be fast when drawing, it is using the depth buffer of the viewport to place the strokes.
The issue is that the depth buffer has precision issues:
https://www.youtube.com/watch?v=Sfy6pB0susM

But if we were to switch to a more robust method, it would be quite slow and it would not be a pleasant experience for drawing in real time.
I guess we might work around this by implementing some kind of shrink wrap modifier for GP strokes.

I'll leave the last word to @Antonio Vazquez (antoniov) but I think that this is a limitation of our current code and not a bug.
Feature requests go to: https://blender.community/c/rightclickselect/

@Sebastian Parborg (zeddb) Your explanation is perfect, this is the root of the problem.

Yes, the "real" solution would be implement a shrink warp modifier.

The Surface placement paired with converting the GP layer to a bezier curve and shrinkwrap modifier gets me close enough to the goal.

I'll just expect to lock down movement while drawing to avoid initial surface placement issues.

Thanks, guys!