Hi, I’m trying to optimize a very simple scene in Unity and I don’t know what to do anymore, I disabled every logic in it and left only the my weather system and I only get 48FPS, there is nothing more running in the game, no GI, no image effects, in the same rig in games like GTA 4 and Skyrim I get around 55FPS with the settings quite high.
Also GTA 5 which I forgot to mention, it runs at around 50FPS.
What is the impact of PBS on a very simple scene? The only thing my system is doing is passing the time and decreasing some variables (to randomize a new weather state when the timer reaches 0)…
According to profiler: the weather system (Time of Day and some custom stuff I made to control the time and the weather) is taking something around 0.10ms with pikes at 0.14ms + the rendering that takes 3-4ms. ALL the scripts together is taking around 0.3ms to 0.4ms including the weather system.
in the editor (resolution 2498x949):
Without weather system: 49
With weather system (+ atmospheric scattering): 42
in the build (2560x1080):
without weather system: 47
with weather system (+ atmospheric scattering): 40
I’m only using the standard shader.
My specs are i7 970 2.93ghz, 8gb Ram 1666, GTX650 Ti 2gb.
EDIT: Actually, GTA V runs at 55~60FPS, if I set everything to normal it runs at 60~70FPS, but well, Rockstar did really a good job with GTA V so I think we can’t compare that, but still, the scene I’m talking about in Unity is too simple anyway.
Mostly for Gfx.WaitForPresent, which tells me nothing:
I already searched about this entry in the profiler, and according to this comment on the oculus forums… https://forums.oculus.com/developer/discussion/comment/260638/#Comment_260638
…it’s something else’s fault, but what? The profiler gives me nothing since everything else below the camera.render takes less than 1ms every frame.
You mean profiling the build? If yes, I get almost the same results Gfx.WaitForPresent on the top eating ~24ms, below it I get the Camera.Render with ~3.5ms and below it only stuff with less than 0.25ms…
Well, I’ll keep working on my game without worrying about this, there’s absolutely nothing I can do, I can disable everything in the scene but then I will have no game, maybe I change the art direction of the game for something more simple… this is the scene I’m trying to optimize btw, but I removed almost all the grasses and also decreased the detail density to 0.4 to make the tests.
Yeah looks like your problem’s fill rate I guess. That’s a lot more fill than GTA 5 does. It basically means your foliage is probably causing too much overdraw. You can tell if this is the case if it gets a lot faster with a lower resolution. Test that out. If it does, it generally means you’re fill rate bound.
If that’s the case then it’s probably time to examine what shaders you’re using on the green bits, and so on.
Hey, thanks man! Yes, I’m still thinking what I can do but seems like this is the best way to go for this type of game IMO…
I think I found the problem and also learned how to get rid of that Gfx.WaitForPresent thing (kinda, since the guys from this thread http://forum.unity3d.com/threads/gfx-waitforpresent.211166/ already did what I did), I was using a bloom image effect, it was the only image effect that I was using (+ the required image effects from the Time Of Day), and disabling them I was getting some milliseconds on the CPU and also this Gfx.WFP was also decreasing, the guy on the oculus forums said that this happens because the CPU has stalled waiting for the GPU do its thing but I was not understanding why because the profiler shows “GPU: 0.00ms” UNLESS you add the GPU profiler, as you can see on my image I was only using the CPU profiler, when I added the GPU profiler the “GPU 0.00ms” updated to the real count and by checking what was taking the GPU time (which was the image effects like I said before) I could gain some FPS. There was my fill rate I guess.
Everything it’s still very weird because that means I can’t have image effects, if I add some image effects there goes my FPS again below 60, in the end, pretty much everything takes a lot of the GPU and that’s very very odd.
thanks for replying guys, I will keep looking for ways to improve the performance of my game!
I said on a post, I removed almost all foliage and also decreased the detail density (all my foliage is detail textures, no trees) to 0.4, less than this the terrain will look too flat…
edit: that image was before I did this.
edit2: this is how it looks now from the same position of the previous image:
I also removed some trees, I will keep them more spaced.
Grass isn’t really the problem, it’s trees. Grass doesn’t overdraw as much as people think it does. Nor does it matter how much overdraw really you do, if each pixel is very quick to render.
The shader complexity plays a huge part in what you call fill rate, as a pbr foliage shader will take a lot longer per pixel than a simpler cutout shader.
Your trees probably have the same shader for each lod stage, another bad call. It should reduce in shader complexity as well as in polygons.
The resolution test tells you if its a fillrate bound.
If the trees and the grass can get away with a simple cutout shader for the green parts, you will have already eliminated a ton of fill rate since it won’t draw pixels behind others.
I’m using some free speed trees that I found with their default shaders, I think that may be the problem too then.
Increasing the resolution really does impact the FPS more than it should I guess. Do you know if the unity standard shader with the cutout option is suitable for this situation?
But looking for parts of the scene that has no trees doesn’t change much the FPS to say the truth…