gpu bug ?

Started by MichaelJPCT, January 11, 2019, 04:36:14 AM

Previous topic - Next topic

MichaelJPCT

my project sometimes has 2 transparent objects(shadows) overlapping but at the same height.
on Powervr 6250 gpu , the objects flicker, like the behavior of Z-fighting. on maliT720, it doesn't happen.
it shouldn't happen because they are transparent, they should co-exist.
what might be the cause of Z-fighting and can it be fixed?

EgonOlsen

Strange. Do you have a screenshot?

MichaelJPCT

i don't have a way to take screenshots on that device yet, so i use real camera to shoot the imgs.
2 shadows are overlapping in these screenshots(the meshes holding the texture is much larger than the dark area of  shadow).
shadows are at exact same height.
the shadow closer to camera flickers(always true).

EgonOlsen

Might be an issue with rendering tiles on PowerVR. It would be interesting to know how wide these blocks are. I expect them to be 32 pixels...

MichaelJPCT

i don't know the size of the flickering squares, but might be 32. the width of screen is 1920. the squares are axis-aligned to  screen.
but the patterns of flicker are multiple, sometimes i see narrow bands. pattern changes with camera position and angle, not by time.
i tried setting usePowerVRTweaks to false, and the whole device hanged. i had to turn off power to reset it.

MichaelJPCT

i roughly calculate the size of squares, it is most likely 32.

EgonOlsen

Then it seems to be an issue with the tiles that PowerVR uses for rendering. I would say it's a bug of some kind...I'm not sure what to do about it.

MichaelJPCT

i suspect that when a transparent object is rendered, depth buffer writing is enabled with powervr gpu, which shouldn't be done.

EgonOlsen

I'm not sure if it's that simple. In that case, I would expect to see some of the usual artifacts of z-fighting. But here, nothing looks fuzzy...it's all nice and sharp rectangles. PowerVR is a tile based renderer. It sorts polygons before it renders them and it does that in 32*32 pixel sized tiles. The goal is to delay the rendering until only the top most triangle per tile is known and then render only that to save bandwidth. It looks like as if something goes wrong here with that approach in this particular case. But it's an internal thing...I don't see how to fix this from the outside.

MichaelJPCT

i tried disabling depth write before drawing the shadows(the mesh holding the texture) , the result is better - from most angles they are correct, still from some angles , wrong.
without that fix , from most angles shadows are wrong.

EgonOlsen

I'm not sure how you setting up your rendering, but as fas as jPCT-AE is concerned, it doesn't do depth buffer writes for transparent objects anyway, because that would actually render them wrongly.

MichaelJPCT

there is no problem on mali gpu , so should be the problem of powervr gpu