Download

Why does FPS drop when looking away from SunSky?

I’ve got a simple landscape setup with some grass foliage scattered around the center of it. When I look towards the sun, I get a fairly high FPS, however, when I look away from the sun, I get a massive FPS drop. This happens even if there is less foliage when looking away from the sun. 110 FPS vs 70 FPS

You’ll notice in the two images, there is almost twice as much foliage in the direction towards the sun than away, in fact it goes until the culling begins, and yet the FPS remains quite high. And just to note, I’m in the center of of the landscape and I currently have Ray Tracing disabled.

I also tried removing the sun sky and just used a default directional light and ended up with the same results.


You need to profile your scene, at the very least use stat unit so you can see where your performance is going.

https://www.youtube.com/watch?v=SXLYy6D1y80

When you are looking away from the light, you have more objects rendering into the shadowmap.

It’s not looking away from the sky, it’s looking at the grass… :wink:

Thanks for the feedback everyone. On the GPU profiler it does show the ShadowDepths pass getting pretty massive when looking away from the sun. I guess it just took me by surprise how big of a difference turning from the light source had. I’ll have to keep playing and see if I can get the shadow performance improved with the grass somehow.

start by trying early z pass.
its within project settings.
Works OK for Epic’s default stuff usually.
Personally I don’t see a negative impact using it on high vertex stuff, but I don’t see a gain either.

Personally for grass and other minor foliage I’d turn shadows off.

I remember there is a bug with foliage grass tool in editor where tiles near the center of the level do not get de-spawned correctly. The grass instances still culled using distance culling, so they are often not visible, but they still remain spawned so when you look in a direction of a level center, you will get significant dip in framerate. Is there any chance you are experiencing similar issues? That it’s not really about the sky direction but rather if the camera is looking away from the level origin vs towards it?

That’s an interesting bug and thanks for bringing it up. Unfortunately that’s not the case because if I move even further back from the center and look at the sky over the center of the level, I still get less FPS when looking away from the sun than looking towards it. Also, the issue isn’t as relevant when I raise the sun higher in the sky because there is less shadowing happening in one direction. I included some shots with the sun high to showcase.

I’ll give this a try and see if it gives any positive effects, thanks!






How did you setup the mesh LOD?

May not have anything to do with the grass. Try rebuilding your lighting a couple of times. I know it sounds rediculous, but in the past ive had bugs where i build it one time and my draw calls went up by like 100k if i looked in 1 direction… then i build it another time right after and it self corrects whatever the problem was…

I was using some Megascans grass models with pretty strict LOD falloff. I think I had 4 levels of LOD. I’ve since moved to the UE4 acquired Project Nature grass since I can’t currently edit Megascans grass with Houdini to add pivot painter (Houdini’s pivot painter broke after a UE4 update to how it behaves) I made a few edits to make the LODs a little bit more strict, but the same issue occurred with all grass types. Once again, if I look at the sun I can have 10,0000 grass showing with great FPS, but when I look away even if I only have 1,000 or 2,000 grass showing the FPS drops quite a bit. I also did tests forcing min LOD to the lowest LODs but it had little effect on the issue.

Thanks for the tip, unfortunately it can’t be a light building issue as the entire scene is Dynamic lighting. In fact I have Static Lighting disabled on the project. I’ll keep this in mind for any future static light builds though :slight_smile:

It definitely has to do with shadow casting from a direct light low to the horizon.

Luckily since the main premise of my game will happen at night, it isn’t as big of an issue (below screenshots show 10fps loss vs 2 fps loss). I do want try and have the beginning of the game start a little before sunset however, so I’m just on a mission to see what I can do to help improve performance as I’ve found that to be the most expensive lighting.

Hmmm Did you check your light mass settings in world settings? How many Lights do you have? I recently had an fps issue and didnt reralize i accidentally copied my main light 2 times and it was rendering 2 lights.

in editor click on lit/optimization view modes/shader complexity and light map density. it may help to visualize where things can be overloading that are not visible in lit mode.