Water making 50 FPS difference

Water4 making a 50FPS difference?

(A little more detail about what’s going on)
Hello everyone, so recently I’ve been working a project, and it includes a fairly large terrain with lots of objects everywhere. I knew performance would be an issue I’d have to deal with, but it’s way to early to get 20 FPS :smile:
So I knew I had to start tackling the problem early on. I started reading up on performance, trying to figure out the profiler(and failing to do so :smile:) trying to use LODs and other optimizations. Currently, depending on where the camera is pointed, my game runs at anything from 60FPS to 20FPS. Changing LOD settings for trees and disabling shadows(Something I do not want to do) helps the framerate a bit, but when I disabled 3 Water objects, the framerate went from 20 to 70-75. I tried changing the settings on the Water4 objects, turning them to low quality, but they kept eating up frames, only disabling them gives the massive frame boost.

Since I really need the water to be present in my game, I’m looking for some insight on this subject, is this supposed to happen? What is an inexpensive way to have water in your scene?

In my scene, I have up to 3.5Million Tris and Verts and around 3K drawcalls.
I tried using the profiler but it confused me lol. However I did notice that 90% of the CPU was going towards water occlusion, sadly I’m not too sure what that means.
Please excuse the lack of technical knowledge, hope to get some ideas!

Thanks!

EDIT: I just noticed water is adding 2Million Tris and Verts, am I doing something wrong, or is Water4 really that expensive?

I know once for me, I had 2 waters and it killed performance completely because of a tiny small puddle of water. How many water prefabs do you have?

I have 3 Water4 prefabs. They seem to make up 2/3 of my geometry for some reason, however, I’m starting to get worried because the frameboost is being inconsistent, I’m just so bad at understanding performance, it’s really frustrating because my game looks terrible and it’s not even finished yet and it runs 30 frames lower than super polished AAA games.

Are you running reflections? They’ll eat up a lot of performance as the geometry has to be rendered twice. If it’s background water you can just use the sky’s cubemap as the reflection, or if you really need surface reflections, use an SSR shader as a cheap method to simulate reflections (available in the asset store or eventually in Unity).

1 Like

I tried disabling reflections, it didn’t make a difference at all, only disabling the prefabs does. But its not just the water even, at this point, for some reason I am at <60 FPS with 1.5Million Verts and Tris. I don’t have any fancy scripts or anything of that nature, any ideas on how to know what’s going on? The profiler looks promising but I’m having a bit of trouble understanding it.

Edit : I’m running an i7 2600K 3.4Ghz and Nvidia GTX 560 Ti with 4GB of RAM.

Disable each water 1 by 1 until it gets better. If it doesn’t get better, then it’s something else. Like completely disable them by ticking the check mark at the top in inspector.

Probably need to think in millisecs cost rather than fps, because fps can’t really be measured properly - for example larger >200fps ranges only need a small couple of millisecs worth of change to rip 50fps off it.

Just worth bearing in mind.

2 Likes

Hippo is right. You can visualise a graph mapping frame rate to milliseconds per frame as y = 1000 / x, where y is the framerate and x is the number of milliseconds. It’s not a good measure of performance cost because it’s not a linear function, making comparisons more difficult. The profiler would be a much better tool to find out what’s going wrong.

Thanks for all the replies guys, I’m trying to look into the profiler a bit more now, it’s pretty detailed to say the least, I’ll let you guys if I find anything out!

Reading up on Occlusion Culling atm, looks like it’s just the thing I need!

As @Stormbreaker says, you’ll need to reduce the reflection density and lower certain settings… It’s been a while since I’ve used it, but wasn’t there a quality setting on the water script?

Did you consider using another water solution such as Fluvio?

Yes they have 3 quality settings, it didn’t do too much for me though.
I haven’t tried Fluvio, but I might give it a try.
Occlusion Culling seems so good but it’s not behaving as I want it to. When the camera gets too far from hidden objects the culling is stopped and the objects are visible, which is the opposite of what i want since I need far away objects to be culled :smile:

For that I’d just write script that would disable renderers based on distance from the player.

Great idea thanks!

You’re welcome! BTW. Check devlog of my game, link in my sig!

Change the far clip plane of your camera to do this automatically.

I still want the cliffs and other far things to be visible, however I’ve found a nice solution!

“Camera.layerCullDistances”

I haven’t applied this yet, however from what I understand it allows you to cull objects based on their layer. So I could assign the repetitive small objects to a layer, characters to another etc, and I can have them culled at different distances!
Pretty cool stuff! :smile:

Oh cool, didn’t know about that feature. Would be useful to stop some larger stuff getting culled.

Yeah, I just implemented this, fairly simple to use, and works like a charm! I was so happy when I saw those polys go down :smile: