Author Topic: Fog of war on Mali/PowerVR GPU problem  (Read 2604 times)

fudingyu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Fog of war on Mali/PowerVR GPU problem
« on: July 05, 2015, 11:59:37 PM »
On Qualcomm GPU is perfect!

But while Mali/PowerVR GPU like below picture







Caused of depth texture? some GPU not support depth texture? or not support 24 bit depth buffer only run 16 bit?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,149
  • Toronto, Canada
    • View Profile
Re: Fog of war on Mali/PowerVR GPU problem
« Reply #1 on: July 06, 2015, 08:59:44 PM »
That's pretty messed up. Something isn't supported properly it seems, yeah. If you look closer, shadows are messed up as well.

fudingyu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Fog of war on Mali/PowerVR GPU problem
« Reply #2 on: July 07, 2015, 11:21:32 AM »
I thought c
ause of this line code

FOWEffect.cs
mCam.depthTextureMode = DepthTextureMode.Depth;

Not support depth buffers 16 bit, so camera overlay a bad depth.

Do you have any idea fix it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,149
  • Toronto, Canada
    • View Profile
Re: Fog of war on Mali/PowerVR GPU problem
« Reply #3 on: July 08, 2015, 08:18:19 PM »
There is no way to fix it if the device doesn't support depth textures.

fudingyu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Fog of war on Mali/PowerVR GPU problem
« Reply #4 on: July 08, 2015, 10:14:46 PM »
http://community.arm.com/message/15331

one technique is to mangle your vertex shader (which is fp32 precision on Mali) output to emit a depth value which is designed to generate different distribution of depth values. This can, for example, make the rasterized depth a linear distribution in the Z-buffer, rather than the usual non-linear one. It's not without issues (you get less Z-fighting in the distance, but risk more close to the camera) - but might be worth a try ...

For more details, try this article: http://www.mvps.org/directx/articles/linear_z/linearz.htm


Above function made help?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,149
  • Toronto, Canada
    • View Profile
Re: Fog of war on Mali/PowerVR GPU problem
« Reply #5 on: July 12, 2015, 08:13:06 PM »
Unfortunately this is something you will need to do on your end. I can't try to hack it myself to work on a specific device that I don't even have.