How do you create an Infinite Ocean effect?

Hey guys, I’ve been looking around and I can’t seem to find any info on how to create an infinite Ocean. I’ve got the water tiles following the player around but there’s only so far one can go with that without it bring the performance down. So how do you do it?
Thanks
Euan

What view does the player have? Is it top down or first person?

First person, Basically I’m making an infinite stranded deep type thing for myself.

What is causing the performance issue and where, CPU or GPU?

1 Like

First thing to do is decide if “infinite” is really a constraint. If it truly needs to be infinite, then you need to keep the player at the origin and move everything else around relative to the player. That is the only way to achieve “infinite” distances in a video game.

2 Likes

I have a system like that down, it lets the player move around in an x by z space than once the player exits that space it centres him and offsets the rest of the world. The issue is that the islands I’m making are quite a bit bigger than stranded deep’s so when you reach the top of an island you can see the end of the water.

It’s the CPU. It is the unity water tiles which are causing the issue.


With 16 by 16 water tiles I get 43 fps, and they’ve been scaled by 4. So the ideal for me would be that I can have normal sized unity water arround the player, then maybe some sort of graphical trick to make it look like it goes on for ever, any ideas?

I would look into using vertex shader for animating water.

It would also help if you uploaded a minimal stripped down example that demonstrates the problem.

1 Like

The problem isn’t necessarily the performance, it’s how to create an infinite ocean effect

In your case the problem is performance. Infinite ocean effect is done the way you’re doing it. You have an ocean plane and you tile it, animate it, etc. However, your project can’t handle the number of animated ocean planes you have, and that is a performance problem. The approach looks correct to me.

Fog and a good Skybox, the default Unity one always seems to have the ground plane too high (above 0).

If you can get the Fog and Skybox to work together you can have a nice effect. Even bringing in the Fog a lot closer adds to the mystery of the game (reducing the focal length of the camera can massively reduce draw load).

Also you can make a fractional scale model of the world in a different layer and move a camera around in it that generates the skybox textures in your game, so distant islands or dynamic clouds (particle fx) can be shown in your games skybox.

Remember it’s all smoke and mirrors in games you only have a small simulation sandbox to play in as your CPU and GPU power are limited.

2 Likes