I want to make a game where you’re exploring a completely dark building with only a lamp. So for making that shadow effect I’ve just given the player lamp with actual point light with enabled shadows and made new shader for all objects (shader from here: Unity 5: Using mobile shaders with Point Light and Spot Light - Questions & Answers - Unity Discussions).
When there was only the player and the rooms I was able to get 60 fps on my phone, but then I added objects, character model and post process with color grading and grain. After that I can get only ~25 fps with 0.7 dpi scale. Is there a way to somehow fake point light shadows or get the similar effect? I recorded a little gameplay video where you can see what I want to get: TopDownStealth - Google Drive
Bump
Well regardless of your line of sight question, running post processing on mobile is expensive, and doing so at a constant 60 FPS is probably impractical on most devices.
Thermal throttling is a serious issue and doing PP at 60 FPS isn’t helping.
Just tested the game and you’re right. Without shadows, one material for all objects but with PP (vignette, color grading and grain) and it runs only 25-30 fps! Is there a way to fake PP?
You could probably fake vignette with an overlay image made in photoshop or something. But you need to test performance to see which is faster. The problem with PP on mobile is that simply turning it on, with no specific PP effects, already has a significant penalty.
So basically:
- use as few PP effects as possible
- tune the PP effect parameters for performance where possible
- if you can avoid activating PP layer on the camera you will save a ton of performance.
Also try using the builtin PP stack of URP in 2019.3. Unity claim that it is faster, but from my tests, mainly around Bloom, I didn’t see any significant difference on my device. Which is also an issue - your mileage will vary greatly depending on the device, and also the graphics API (Metal / Vulcan / openGLES).
Also: unless you have the engineering capacity to invest a lot of time and effort into optimizations, I would give up on running at 60 FPS on mobile. Aim for 30. For short periods it’s not hard, but you’ll have a lot of trouble keeping it at 60 with thermal throttling, and especially with the huge variance in device specs.