Grease pencil occluded by other objects while drawing, then appears on release #86029

Closed
opened 2021-02-26 20:14:29 +01:00 by Dolphin Dream · 11 comments
Member

System Information

Operating system:
Graphics card:

Screen_Shot_2021-01-19_at_12.35.10_PM.png

Blender Version

Broken both in 2.93 alpha and 2.92

Short description of error
The GP strokes are incorrectly occluded by presence of other meshes in the scene. I first noticed this behavior when I added an empty/image with a chalkboard image (which intended to place in XZ plane) so I can use the GP to drawn as if I was drawing on a chalkboard, but the stroke would not always appear on the board while I was drawing, but it would only appear after I released the mouse (ending the GP stroke). I tried to move the empty (image) back along Y a little bit, thinking that maybe drawing with GP in XZ plane conflicts (depth z-fights?) with the image displayed in the same XZ plane, however the GP stroke occlusion still occurs even if the image was placed behind the XZ plane.

To isolate this I then tried to see if this effect happens even with a regular mesh (not just empty/image).. so I added a simple plane object to the scene and move it along Y by some amount (not to be exactly located in the XZ plane). Then with the GP “align strokes to current view” mode set to either “Front (XY)" mode or “View" mode it appears that for some angles of the user camera the GP stroke is partially or completely occluded by something (obviously has something to do with the plane mesh, but it’s not exactly occluded by the plane footprint). For different angles of the user camera this masking area seems to be always different. I noticed this masking area to be somewhat triangular in nature within the plane mesh bounds.

In “view” mode I would expect the GP strokes to disappear as the strokes (drawn on the plane parallel to the view, passing though the origin) go behind the plane mesh (and indeed they do in “view” mode) but the strokes also partially disappear in other parts of the screen over the plane mesh even when the strokes are supposed to be in front of the plane mesh. (as you can see in the attached screen capture). Some of these partial occlusions still persist even after releasing the mouse ending the stroke.. as you move the user camera around you could see parts of the strokes in front of the plane mesh get a different shade of gray.

GreasePencil-Occlusion-BUG-demo1-720.mov

And here is a demo with strokes being occluded while the mode is “Front (XY)”. It appears that the algorithm used for this mode also uses the same masking (depth maps?) used for the “view” mode while drawing (when ending the stroke the GP stroke is mapped in 3D to the XZ plane and it’s shown not occluded). In this drawing mode the occlusion while drawing seems to be incorrect however (both the partial and the complete occlusions).

GreasePencil-Occlusion-BUG-demo2-720.mov

Exact steps for others to reproduce the error

See attached blend file.. (simple plane mesh parallel to XZ plane at a small Y location away from XZ plane). While in GP draw mode, rotate the user camera around and then draw a continuous stroke all over the plane mesh (outside or inside the plane bounds). You should see the strokes being occluded (partially or completely) in some parts of the viewport (within the bounds of the plane mesh). When releasing the mouse to end the stroke the entire GP stroke should appear. (note: in “view” mode some parts of the stroke may be going through the plane mesh so they are legitimately occluded after ending the stroke).

greasePencil-occlusion-BUG.blend

**System Information** Operating system: Graphics card: ![Screen_Shot_2021-01-19_at_12.35.10_PM.png](https://archive.blender.org/developer/F9842798/Screen_Shot_2021-01-19_at_12.35.10_PM.png) **Blender Version** Broken both in 2.93 alpha and 2.92 **Short description of error** The GP strokes are incorrectly occluded by presence of other meshes in the scene. I first noticed this behavior when I added an empty/image with a chalkboard image (which intended to place in XZ plane) so I can use the GP to drawn as if I was drawing on a chalkboard, but the stroke would not always appear on the board while I was drawing, but it would only appear after I released the mouse (ending the GP stroke). I tried to move the empty (image) back along Y a little bit, thinking that maybe drawing with GP in XZ plane conflicts (depth z-fights?) with the image displayed in the same XZ plane, however the GP stroke occlusion still occurs even if the image was placed behind the XZ plane. To isolate this I then tried to see if this effect happens even with a regular mesh (not just empty/image).. so I added a simple **plane** object to the scene and move it along Y by some amount (not to be exactly located in the XZ plane). Then with the GP “align strokes to current view” mode set to either “Front (XY)" mode or “View" mode it appears that for some angles of the user camera the GP stroke is partially or completely occluded by something (obviously has something to do with the plane mesh, but it’s not exactly occluded by the plane footprint). For different angles of the user camera this masking area seems to be always different. I noticed this masking area to be somewhat triangular in nature within the plane mesh bounds. In “view” mode I would expect the GP strokes to disappear as the strokes (drawn on the plane parallel to the view, passing though the origin) go behind the plane mesh (and indeed they do in “view” mode) but the strokes also partially disappear in other parts of the screen over the plane mesh even when the strokes are supposed to be in front of the plane mesh. (as you can see in the attached screen capture). Some of these partial occlusions still persist even after releasing the mouse ending the stroke.. as you move the user camera around you could see parts of the strokes in front of the plane mesh get a different shade of gray. [GreasePencil-Occlusion-BUG-demo1-720.mov](https://archive.blender.org/developer/F9842903/GreasePencil-Occlusion-BUG-demo1-720.mov) And here is a demo with strokes being occluded while the mode is “Front (XY)”. It appears that the algorithm used for this mode also uses the same masking (depth maps?) used for the “view” mode while drawing (when ending the stroke the GP stroke is mapped in 3D to the XZ plane and it’s shown not occluded). In this drawing mode the occlusion while drawing seems to be incorrect however (both the partial and the complete occlusions). [GreasePencil-Occlusion-BUG-demo2-720.mov](https://archive.blender.org/developer/F9842927/GreasePencil-Occlusion-BUG-demo2-720.mov) **Exact steps for others to reproduce the error** See attached blend file.. (simple plane mesh parallel to XZ plane at a small Y location away from XZ plane). While in GP draw mode, rotate the user camera around and then draw a continuous stroke all over the plane mesh (outside or inside the plane bounds). You should see the strokes being occluded (partially or completely) in some parts of the viewport (within the bounds of the plane mesh). When releasing the mouse to end the stroke the entire GP stroke should appear. (note: in “view” mode some parts of the stroke may be going through the plane mesh so they are legitimately occluded after ending the stroke). [greasePencil-occlusion-BUG.blend](https://archive.blender.org/developer/F9842902/greasePencil-occlusion-BUG.blend)
Author
Member

Added subscriber: @MariusGiurgi

Added subscriber: @MariusGiurgi
Author
Member

More findings.. actually this behavior may not even be related to having meshes in the scene at all. If I add a picture (e.g. a chalkboard pattern) to the camera to be displayed (thorough the camera) as a background image, the same occlusion effect occurs.

GreasePencil-Occlusion-BUG-demo3-720.mov

More findings.. actually this behavior may not even be related to having meshes in the scene at all. If I add a picture (e.g. a chalkboard pattern) to the camera to be displayed (thorough the camera) as a background image, the same occlusion effect occurs. [GreasePencil-Occlusion-BUG-demo3-720.mov](https://archive.blender.org/developer/F9843702/GreasePencil-Occlusion-BUG-demo3-720.mov)
Author
Member

And another example with the background image opacity set to 1.0.. where the occluded part of the stroke has a different blending and it is more pronounced.

GreasePencil-Occlusion-BUG-demo4-720.mov

And another example with the background image opacity set to 1.0.. where the occluded part of the stroke has a different blending and it is more pronounced. [GreasePencil-Occlusion-BUG-demo4-720.mov](https://archive.blender.org/developer/F9843739/GreasePencil-Occlusion-BUG-demo4-720.mov)
Author
Member

And for what it’s worth.. here’s another example illustrating the occlusion for different camera orientations.. for each orientation the occlusion seems to be different, which indicates it may be related to not just the camera but also its orientation relative to the world.

GreasePencil-Occlusion-BUG-demo5-720.mov

And for what it’s worth.. here’s another example illustrating the occlusion for different camera orientations.. for each orientation the occlusion seems to be different, which indicates it may be related to not just the camera but also its orientation relative to the world. [GreasePencil-Occlusion-BUG-demo5-720.mov](https://archive.blender.org/developer/F9843759/GreasePencil-Occlusion-BUG-demo5-720.mov)
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Looks a bit like a mixed bag of issues:

  • the delayed update has been reported here [it is a known limitation due to performance reasons] #85764 (Grease pencil stroke partially invisible until mouse-up)
  • does Fade Inactive Geometry have an influence on the blending issue you descriibed? (see #85207 (Grease pencil strokes are incorrectly blended with geometry in draw mode (depending on 'Fade Inactive Geometry' setting)))
Looks a bit like a mixed bag of issues: - the delayed update has been reported here [it is a known limitation due to performance reasons] #85764 (Grease pencil stroke partially invisible until mouse-up) - does Fade Inactive Geometry have an influence on the blending issue you descriibed? (see #85207 (Grease pencil strokes are incorrectly blended with geometry in draw mode (depending on 'Fade Inactive Geometry' setting)))
Author
Member

the delayed update has been reported here [it is a known limitation due to performance reasons

I would like to use GP for live illustration purposes (since the annotation tool is too simple and doesn’t allow custom strokes etc), so having the GP only show on mouse release will not work for me. Maybe such optimization can be turned off if i don’t care about performance issues?

> the delayed update has been reported here [it is a known limitation due to performance reasons I would like to use GP for live illustration purposes (since the annotation tool is too simple and doesn’t allow custom strokes etc), so having the GP only show on mouse release will not work for me. Maybe such optimization can be turned off if i don’t care about performance issues?
Member

Having the GP only show on mouse release will not work for me.

Makes sense

Maybe such optimization can be turned off if i don’t care about performance issues?

This would be a request for modified/improved behavior and not a bug in current behavior which we dont handle in this bugtracker.
For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests
For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug

That leaves us with the blending issue, any update on this (ref, Fade Geometry)?

> Having the GP only show on mouse release will not work for me. Makes sense > Maybe such optimization can be turned off if i don’t care about performance issues? This would be a request for modified/improved behavior and not a bug in current behavior which we dont handle in this bugtracker. For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug That leaves us with the blending issue, any update on this (ref, Fade Geometry)?
Member

Since we didnt hear back about the blending issue, will merge into #85764.
(feel free to comment again though if more information can be provided)

Since we didnt hear back about the blending issue, will merge into #85764. (feel free to comment again though if more information can be provided)
Member

Closed as duplicate of #85764

Closed as duplicate of #85764
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
2 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#86029
No description provided.