Tasharen Entertainment Forum

Support => Other Packages => Topic started by: fudingyu on July 05, 2015, 11:59:37 PM

Title: Fog of war on Mali/PowerVR GPU problem
Post by: fudingyu on July 05, 2015, 11:59:37 PM
On Qualcomm GPU is perfect!

But while Mali/PowerVR GPU like below picture

(http://i.imgur.com/LTiArhG.png)

(http://i.imgur.com/ezjXluM.png)

(http://i.imgur.com/FXpM9S5.png)

Caused of depth texture? some GPU not support depth texture? or not support 24 bit depth buffer only run 16 bit?
Title: Re: Fog of war on Mali/PowerVR GPU problem
Post by: ArenMook 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.
Title: Re: Fog of war on Mali/PowerVR GPU problem
Post by: fudingyu 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?
Title: Re: Fog of war on Mali/PowerVR GPU problem
Post by: ArenMook on July 08, 2015, 08:18:19 PM
There is no way to fix it if the device doesn't support depth textures.
Title: Re: Fog of war on Mali/PowerVR GPU problem
Post by: fudingyu 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?
Title: Re: Fog of war on Mali/PowerVR GPU problem
Post by: ArenMook 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.