Page MenuHome

Images drawn with the Python gpu module no longer draw on top in the Image Editor
Confirmed, NormalPublic


System Information
Operating system: Linux-5.4.43-x86_64-Intel-R-_Core-TM-_i7-7500U_CPU_@_2.70GHz-with-slackware-14.2 64 Bits
Graphics card: Mesa Intel(R) HD Graphics 620 (KBL GT2) Intel 4.6 (Core Profile) Mesa 20.1.0

Blender Version
Broken: version: 2.91.0 Alpha, branch: master, hash: rBf470a02afaea, commit date: 2020-09-20 05:59
Worked: version: 2.91.0 Alpha, branch: master, hash: rB66078594d130

Short description of error
When drawing images with the python gpu module, they will no longer draw on top of the region's contents or of other python rendering.
This problem happens in the Image Editor, but not the Sequence Editor.

(2 square images and a circle are drawn with Python, 'POST_PIXEL' in the Image Editor, which shows a rectangular image)

(the circle, drawn first, shows on top. The Image Editor's image also shows on top)

Exact steps for others to reproduce the error
See the attached .blend file.

Event Timeline

Could this be related to the depth tricks that the image editor currently uses?
What happens when you draw with DEPTH_ALWAYS on? Or with write depth.

Currently when drawing via python it draws directly to the overlay buffer. when transferring to display it might not have the correct data inside the buffers.

I will check later today with renderdoc to see what is happening and what needs to be corrected/documented.

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Sep 21 2020, 3:36 PM

The circle is rendered with gl_depth 0, write depth is on and depth function is less equal.
The textures are rendered with gl_depth 1, write depth is on and depth function is less equal.
The image of the image editor is drawn using gl_depth of 0.75 as part of the new draw pipeline.

Looking at the gl_depth is set to 1 for images so they always render in the background.
This was introduced by what seems to be out dated as we have done several overhauls in this area. (workbench refactor, overlay engine refactor, color management pipeline).

A heads up, drawing images in POST_VIEW doesn't work at all in the 2.92 Image Editor, could this be related? I've tried various z positons without success in this case though it works fine in 2.91.