1. Download the test project from the attechment.
2. Open the project with UE 4.21 and 4.23, build android apk.
3. Install the apk on some Mali GPU devices and Adreno GPU devices ,like samsung S6 and samsung s8.
4. Compare the frame rate between the two versions, the 4.23 apk performance is significantly slower than 4.21.
We use stencil test to mask out the areas where can receive decals, but it will have a significant performance hit on some mobile devices when doing stencil write and pixel clip at the same time.
Before 4.21 we don't do stencil write if there is no deferred decal in the scene, but in 4.23 we always write stencil buffer no matter there is a deferred decal or not.
I think there are several ways to avoid the issue in 4.23:
b.Only the stencil value equals to 80 can pass the stencil test when rendering decal.
c.Sort the MeshDrawCommands with bReceiveDecals flag first to have them are renderred last
3.Add a mask depth pre pass and render masked mesh with opaque shader and do depth test using equal func at the mobile base pass.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-81085 in the post.
3 |
Component | UE - Platform - Mobile |
---|---|
Affects Versions | 4.23 |
Created | Oct 1, 2019 |
---|---|
Resolved | Aug 27, 2021 |
Updated | Aug 27, 2021 |