Switch mobile renderer to use fixed PCF kernel.#114038
Conversation
54d83c8 to
f1af3eb
Compare
|
I implemented what was necessary for omni lights to wrap around correctly on the atlas. What remains now is mostly up for debate, as merging this would irreversibly change how the shadows look in mobile renderer projects, and adding a toggle for it might be complexity that most users won't deal with. |
Use OptimizedPCF from the Witness. These kernels require fewer samples and are higher quality when compared to Godot 3.x's PCF. Co-authored-by: Clay John <claynjohn@gmail.com>
f1af3eb to
923fa06
Compare
|
Discussed in the rendering meeting today. To get this into a mergable state, we should basically allow both paths, switchable with a project setting. I.e. add something like |
|
Agreed on making it a project setting, since the Mobile renderer has some use on desktop configs as well (slightly more FPS for games with just basic lighting). Players could have the option to turn it on or off via in-game settings for integrated graphics (which could help, as I noticed my laptop's integrated Radeon has had trouble with high-quality shadowmapping in the past). |
Could be an issue for filtered sharp (cel-style) shadows (they'd look a bit blockier). But some trade-offs are to be expected I think. |


This PR changes the mobile renderer to use fixed kernels for shadow sampling, which can provide some pretty massive performance boosts on mobile devices when opting to use soft shadows. However, it currently breaks features such as soft shadow scaling, as the algorithm in use is not compatible with the concept of scaling as it is implemented.
As measured by @clayjohn on an Adreno 640...
It is pretty clear that the use of a simpler kernel that doesn't rely on disk sampling can provide a pretty significant performance difference on lower end devices. However, since this PR breaks the aforementioned feature and changes the visual quality result, it is left as a draft until it is decided if the engine wants to take this approach going forward. Regardless, the PR can prove to be useful to developers who wish to use a simpler and more performant technique.
To my understanding, it was originally the intention for the mobile renderer to use techniques like these as the quality trade off is less visible on these platforms, but the implementation ended up being shared with Forward+ due to the code's structure, resulting in using a technique that might be a bit overkill depending on the developer's needs.
(as PCSS won't be available anymore in Mobile for any light type, rather than being in a half-working state currently).