Author Topic: gpu bug ?  (Read 3777 times)

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
gpu bug ?
« on: January 11, 2019, 04:36:14 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: gpu bug ?
« Reply #1 on: January 11, 2019, 08:59:40 am »
Strange. Do you have a screenshot?

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: gpu bug ?
« Reply #2 on: January 11, 2019, 12:59:43 pm »
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).

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: gpu bug ?
« Reply #3 on: January 11, 2019, 01:07:29 pm »
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...

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: gpu bug ?
« Reply #4 on: January 11, 2019, 01:42:42 pm »
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.

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: gpu bug ?
« Reply #5 on: January 11, 2019, 01:51:12 pm »
i roughly calculate the size of squares, it is most likely 32.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: gpu bug ?
« Reply #6 on: January 15, 2019, 12:23:32 pm »
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.

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: gpu bug ?
« Reply #7 on: January 15, 2019, 05:08:09 pm »
i suspect that when a transparent object is rendered, depth buffer writing is enabled with powervr gpu, which shouldn't be done.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: gpu bug ?
« Reply #8 on: January 16, 2019, 08:45:23 am »
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.

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: gpu bug ?
« Reply #9 on: January 19, 2019, 09:51:09 am »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: gpu bug ?
« Reply #10 on: January 19, 2019, 04:07:14 pm »
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.

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: gpu bug ?
« Reply #11 on: January 19, 2019, 05:29:43 pm »
there is no problem on mali gpu , so should be the problem of powervr gpu