Invisible water sucks up performance

i'm rendering a landscape with a lot of stuff on it. at some places, everything is reflected by small rivers. the problem is, the reflection affects the performance even if the water is completely invisible. anything i can do?

What does your water geometry look like? Does it happen to be a huge plane spanning all your world? If yes, try to partition it.

Btw, what kind of "invisible" do you mean? Frustrum culled invisible, occluded by other geometry invisible, CULL_ALWAYS invisible, or what else?

i don't know. it's copy&pasted from one of the watertests having an unlimited waterplane. by invisible i mean it's below the terrain.

if i partition it, won't this reduce the performance even more because it may lead to a scene being reflected by more than one waterplane?

HamsterofDeath said:

if i partition it, won't this reduce the performance even more because it may lead to a scene being reflected by more than one waterplane?

Not that much if your world is partitioned as well. I'd expect the gain to outweight the double rendering in most areas of the world.
Note that if your terrain and water level are not dynamically changing, partitioning also means that you'll be able to throw away most parts of the water, because they are entirely under the terrain level.
For reference, see my orpg demo with bounding volumes shown, and look for the terrain and water bounds. I got a good fps boost by partitioning the water (which is however not reflective), with the additional bonus that now I can have different water levels in different parts of the world.

I think the real problem here is that there's more than 1 call to draw the water. The scene reflection is generated each frame as far as I know, so if you use a single water pass with many planes you wouldn't have much performance loss. Another alternative would be to use my occlusion render queue patch which does not draw objects that are occluded/non-visible on the screen.

Momoko_Fan said:

Another alternative would be to use my occlusion render queue patch which does not draw objects that are occluded/non-visible on the screen.

But wouldn't you have to partition the water for that too?

For water partition look here: http://www.lolcatbible.com/index.php?title=Exodus_14

Landei said:

For water partition look here: http://www.lolcatbible.com/index.php?title=Exodus_14

"Ceiling Cat will gives u cheezburgers!" XD thanks a lot for sharing that!
But wouldn't you have to partition the water for that too?

No, the performance is lowered because a reflection scene is rendered to a framebuffer, not because the water quad itself is being rendered. By checking if the water is occluded/invisible first, you can skip rendering the reflection scene.
Momoko_Fan said:

But wouldn't you have to partition the water for that too?

No, the performance is lowered because a reflection scene is rendered to a framebuffer, not because the water quad itself is being rendered. By checking if the water is occluded/invisible first, you can skip rendering the reflection scene.

So it will only work if the entire world-spanning water mesh is occluded? What with the part of the water behind the player, will that be occlusion checked too?