I am creating a 3D demo game in the Universal Render Pipeline featuring an island surrounded by ocean. Currently, I have a beautiful ocean shader which uses the vertices of a plane to simulate waves, and includes sea foam, normal maps, and mixed colors to make a decently convincing look.
The problem is that I want the player to be able to go to the highest peak of the island and be able to see the sun set on the water, with ocean as far as the eye can see. My GPU would hate me if I tried to add in giant tiles of ocean in an enormous grid to create the effect. (Actually, it does hate me, because that’s my current solution.)
I want to know how to use my ocean shader and have it apply pretty much everywhere, or seem to, at least. I am following a tutorial on making a procedural skybox shader, so I could make everything below the horizon of the skybox look like my ocean shader. But I don’t think that would blend well at all with the ocean tiles that have to be on the island’s shoreline.
Maybe fog would help mask the seam between practical ocean and fictional ocean, but I don’t know how to prevent fog from masking the island while masking the ocean horizon; it’s a big island, so if you’re in a corner of it, the distant ocean will be about as far away as the opposite corner of the island. The fog might also block out the sun.
This seems like a really huge problem to me, but plenty of games create infinite oceans, and I know for certain that they aren’t trying to render in tens of thousands of planes within the player’s view distance. Right now, I have around 450 giant tiles of ocean, and my computer isn’t happy. How do games like Just Cause 4 and RDR2 do it?