Ocean Optimisation

It has been fun programming this ocean, and I want to optimise its use. What I  want to use is a method projecting a flat plane from the camera and its frustum onto the ocean, and then use this plane to create my ocean. This would mean that in terms of the mesh i use for the ocean I will be making use of all of its vertices. A really cool method that was also mentioned in the article about the tech behind assassins creeds oceans that inspired me to start this (Assassins Creed Tech Article).

In the image below you can see what i have to do to get this method to work, not only to i have to project onto this invisible plane, but have to account for what to do if the projection does not hit the plane. So all i have to do is reflect the vector off the roof and fire it back down, some fun little math to get this working.

Accidentally left my music on during the video posted below, so enjoy the Persona 3 sound track.

projection of plane

I even managed to take this further by using a really cool site called Desmos to form some equations to force vertices to cluster around the point of focus on the ocean, making even more efficient use of the vertices, meaning i no longer have half of them rendering parts of the mesh being projected onto the horizon. Below you can see the equations on the site and the effect of the clustering.

 

screenshot_Wed_May_25_17.03.49screenshot_Wed_May_25_17.12.50

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s