Page MenuHome

Fix T83529: Horizontal stripe artifacts in image editor
AbandonedPublic

Authored by Germano Cavalcante (mano-wii) on Aug 30 2021, 8:57 PM.

Details

Summary

For a better representation of the pixels of a zoomed out image, the
pixels need to be "interpolated".

For that we can use GPU_SAMPLER_FILTER.

With this path the zoom value is checked and the GPU_SAMPLER_FILTER
applied if desired.

Diff Detail

Repository
rB Blender
Branch
Fix_T83529 (branched from master)
Build Status
Buildable 16696
Build 16696: arc lint + arc unit

Event Timeline

Germano Cavalcante (mano-wii) requested review of this revision.Aug 30 2021, 8:57 PM
Germano Cavalcante (mano-wii) created this revision.
Germano Cavalcante (mano-wii) retitled this revision from Docs: GPU Shader: improve documentation to Fix T83529: Horizontal stripe artifacts in image editor.Aug 30 2021, 8:58 PM
Germano Cavalcante (mano-wii) edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.Aug 30 2021, 10:14 PM
This revision was automatically updated to reflect the committed changes.
  • Fix automatic mess due commit

For me the stripes are still there. (Using resolution scale of 1.76 on AMD GPU + Open source driver.)

Apparently the problem I'm facing is different.
I cannot reproduce what is observed in the image.

@Jeroen Bakker (jbakker), using your attached file and after generating the image, could you copy and run this script in the text editor?:

It generates the same image but through a "draw_callback".

Check if the problem is also seen in the draw_callback image.
At the end, could you also test with the variable USE_BUILTIN_SHADER as True?

The internal shader had the similar results, exect the image was scaled and displayed on a different location due to how the image editor vertex shader works with the actual geometry send to the gpu.

There is a similar issue with the Render View.. When displaying a render at 1:1, panning the Render reveals artifacts.


After Panning ( This is 1:1 Zoom )

source/blender/draw/engines/image/image_engine.c
321

By @Lloyd (digim0nk) comment, this should be modified to also filter if zoom is equal to 1.

It's curious that after panning, a 1:1 scale image shows up with these artifacts.
As the scale 1:1 each pixel is well defined, it is the same pixel of the image.
Should filter really be necessary in this case?
I imagine this must be the result of some float imprecision. The calculated pixel position must be on the border between 2 pixels and the code does not know whether to place it on the right or left, top or bottom.

Maybe there is some way to round the position of the image vertices. I suppose this would solve the 1:1 scale problem and the problem that @Jeroen Bakker (jbakker) noticed.
Need tests...

  • Round Pixel World Position

As much as I move and scale, I cannot reproduce the problem that @Jeroen Bakker (jbakker) and @Lloyd (digim0nk) observed.
So I would appreciate it if you can test the new patch.