Page MenuHome

Grease Pencil Strokes visible behind solid objects
Closed, DuplicatePublic


System Information
Operating system: Darwin-18.5.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 560X OpenGL Engine ATI Technologies Inc. 4.1 ATI-2.8.38

Blender Version
Broken: version: 2.80 (sub 53), branch: master, commit date: 2019-04-01 14:09, hash: rB9ddf0c9d381b
Worked: (optional)

Short description of error
Grease Pencil Strokes visible behind solid objects. That is, within a single Grease Pencil object and you have strokes in front of and behind a solid object, you can see the strokes behind the object through the strokes in front of the object even though the object is completely opaque. This is problematic because I am trying to animate some linework on all sides of a surface of a 3D object.

Exact steps for others to reproduce the error
I am attaching a .blend file here that illustrates the problem. Later I'll describe how I created this file.

To observe the problem:

  1. Open the .blend file
  2. Observe a sphere and 2 grease pencil objects (one has blue strokes and the other has red strokes)
  3. Rotate around the scene
  4. Observe that through any of the blue strokes in front of the sphere you can see artifacts of the blue strokes that should be hidden behind the sphere. You cannot see any of the red strokes from the other GP object behind the sphere.
  5. Observe that through the red strokes in front of the sphere you can see artifacts of the red strokes that should be hidden behind the sphere.

I don't know if this behavior is expected or not. While it could be a cool effect, it completely defeats the workflow I was trying to achieve or it will force me to split my Grease Pencil strokes among multiple GP objects. If I had to guess, it looks like the GP objects are rendered to a separate buffer and merged, which means they only get a single Z value to compare with other 3D geometry. Of course, I haven't looked at the code yet.

How I created the example:

  1. Create a sphere
  2. Create an empty Grease Pencil object
  3. Change the material color to blue
  4. Change the Stroke Placement to Surface
  5. Add a mirror modifier
  6. Draw strokes on all sides of the sphere
  7. Observe the problem described above
  8. Create another empty Grease Pencil Object
  9. Change the material color to red
  10. Change the Stroke Placement to Surface
  11. Draw strokes on the front and back of the sphere
  12. Observe the stroke visibility issue described above



Event Timeline

What mode do you have here?

Set to 3D Location. When you set to default mode (2D Layers) the strokes are visible if you put a mesh in front.

Your file in 3D Location mode.

Note: Anyway, we still have a problem with alpha strokes and we are working to fix it.

I've tried both 3D location (my current setting) as well as 2D layers with much the same effect. Even in the example you posted above, you can see the rear strokes through the sphere, but only where there are strokes in front of the sphere. The effect when animating is that the strokes in front serve as a transparency map for the sphere. Except all you can see through the sphere are the strokes from the same GP object behind it.

Yes, I know for alpha's a already detected problem. Wwe are looking for a solution.

I just tried it with completely opaque strokes drawn with strength set to 1.0 and no pressure sensitivity. This is just to ensure that there is absolutely no transparency involved. If you look from the front (Numpad 1) you can see the that it looks like the far strokes are subtracting from the near strokes. When you look from the back (Ctrl-Numpad 1) it all looks ok.

But, if I reduce the material's stroke Alpha to, say, .5, then you still get the subtractive effect in front view but you get the transparency effect from the rear view.

I'm supplying a new .blend file that shows this. You can play with the material's stroke alpha to see the different effects.