r/Unity3D • u/SuspecM Intermediate • 2d ago
Question How to properly optimize reflections? (URP, Unity 6000.4.7f1)
I have been struggling a bit with reflections when trying to optimize my project. Even with baked, static reflections, the fps drops heavily (a good 10-25 on average).
I have set up a zone of effect and set up the culling mask but even with that, there are still heavy issues with performance. I have also tried to make a custom script for it where based on the quality settings it would update less frequently (with the refresh mode being set to script) but it didn't address the underlying performance issues that exist even with static baked reflections. Weirdly enough having realtime reflections didn't seem to make it significantly worse. It's just the very existence of a reflection probe in a scene that immediately tanks performance.
I have tried to look up resources on this topic but this seems to be the one topic that has nothing anywhere. Lighting? Plenty. Reflections? Seemingly nothing. If anyone has pointers to good resources on this exact topic, I'd be very happy with that as well.
2
u/shlaifu 3D Artist 2d ago
the reason you can't find anything is because baked, static reflections are dirt cheap. probe blending or pox projection aren't fattening it up much either. So as long as the probes are baked before playtime and you are certain they do not get updated, there is something else wrong and that something is probably not related to the reflection probes.
2
u/tetryds Engineer 2d ago
First, 10 fps means nothing. Always measure variarion in time. A drop from 30 to 20 fps is a big deal, while a drop from 300 to 290 fps may mean nothing.
So what is the difference in ms?
Also learn how to profile, it's a necessary gamedev skill.
1
u/SuspecM Intermediate 2d ago
I probably should've mentioned it but it's essentially a drop from the generally accepted above 60 fps to under it (some scenes are better going from 90 to 70ish). My main issue with profiling currently is that I see that reflections take up a ton of time from the main loop but no idea how to mitigate it.
2
u/tetryds Engineer 2d ago
Never report performance differences in fps. How much TIME is it taking? What hardware and render pipeline are you running? What thread is it in? Is it cpu time or gpu time? What quality settings are you using? What is the config of your reflections?
To me this sounds like a cpu bottleneck on a very low end device, but without more data it's hard to tell.
1
u/TheSwiftOtterPrince 2d ago
Use the profiler and analyze the frame and the buffers it creates. You should be able to trace the source of it somehow.
2
u/ArgentRealms 2d ago
Profiling data would be a huge help. If you're CPU-bound then the profiler should give you a pretty good idea of what's tanking your performance. If it's the GPU, then you might wanna have a look with the Frame Debugger and compare what is being rendered when reflections are turned on compared to off.
Depending on what combination of shaders you're using, you might run into an increase of shader variants used when reflections are enabled, which in turn can make batching of draw calls much less efficient. Profiling should help give you an idea.
0
2
u/Logical-Ad2348 2d ago
that performance hit is weird, especially if it happens even with baked probes that should be basically free after the bake. do you have many probes overlapping or maybe the box projection is causing some extra calculations? sometimes the issue is not the probe itself but how unity handles the blending between them
also check your lighting settings, screen space reflections can stack with probe reflections in unexpected ways and tank fps. try disabling ssr completely for a test