Blender 2.80 Grease Pencil surface offset by viewport distance instead of geometry surface #61854

Closed
opened 2019-02-22 16:32:09 +01:00 by Nick · 14 comments

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, 9541ce2c26 Branch blender2.7

and originally found in:

Blender 2.80, 2019-02-08 04:22, 46ac288a93 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).

grease_pencil_surface_offset_bug.blend

**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). [grease_pencil_surface_offset_bug.blend](https://archive.blender.org/developer/F6687522/grease_pencil_surface_offset_bug.blend)
Author

Added subscriber: @NickMade

Added subscriber: @NickMade

Added subscriber: @antoniov

Added subscriber: @antoniov

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.

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.
Author

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!

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 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.
Author

blender_gp_surface_offset rf12.00.mp4

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!

[blender_gp_surface_offset rf12.00.mp4](https://archive.blender.org/developer/F6689216/blender_gp_surface_offset_rf12.00.mp4) 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!

Added subscriber: @ZedDB

Added subscriber: @ZedDB

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sebastian Parborg self-assigned this 2019-03-04 14:28:34 +01:00

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.

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.
Author

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:

blender_gp_offsets rf14.00.mp4

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 b5d87f8028 version.

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: [blender_gp_offsets rf14.00.mp4](https://archive.blender.org/developer/F6759986/blender_gp_offsets_rf14.00.mp4) 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 @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/

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 @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/

@ZedDB Your explanation is perfect, this is the root of the problem.

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

@ZedDB Your explanation is perfect, this is the root of the problem. Yes, the "real" solution would be implement a shrink warp modifier.
Author

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!

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!

Added subscriber: @robertoconde

Added subscriber: @robertoconde
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#61854
No description provided.