Jump to content
  • Advertisement
Sign in to follow this  
PeteD

Semi-realistic Ocean

This topic is 3854 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to make a fairly realistic looking ocean without using too much processing power. There's a little video of what I'm doing at the moment here:
It's basically using a sine wave equation to generate the wave movement. I hit a smooth 60fps (fraps dropped the frame rate in the video) doing this over a fairly small area of water. I'm wondering has anyone got better suggestions on wave generation and are there any possible methods for creating waves over large areas of water? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I'm sure you've heard of perlin noise. Generate textures that hold the perlin noise pattern. (make sure it's tileable perlin noise) and see if that gives what you want. Also I'm just guessing but if you put land points along the shoreline you can perform sine wave offset going towards shore on the water heightmap to get a simple shoreline effect.

Share this post


Link to post
Share on other sites
Yeah I undestand the suggestion of perlin noise but I don't know how you can render such vast amounts of vertices. Here's an example of what I mean:
http://www.inrebellion.com/gamesprog/ocean.jpg
I'm relatively new to this. How do you do something like that?

Share this post


Link to post
Share on other sites
Have you tried breaking the ocean into sub-meshes? If you break them up into smaller pieces you can then calculate a bounding box and test each box against the camera's view. If you get a "collision" then render it otherwise skip that sub-grid. I'm running into a similar problem. The other thought I had is to transform the smaller ocean out in front of the camera as opposed to rendering the entire "map".

Share this post


Link to post
Share on other sites
Well at the moment my ocean only renders what's in the camera's view so unnecessary ocean doesn't get rendered. However if you look at the ocean screenshot from another person's project the amount of triangles that are being rendered and manipulated (moved up and down) is very high. I want to know how it's possible to render and manipulate that many?

Share this post


Link to post
Share on other sites
post the code of how you render the ocean. I don't do 3D programming, but normally you batch the vertices when rendering. Just wanna make sure your not drawing the triangles individually like with some OpenGL GL_TRIANGLES or something. It's been a while since I've used any graphics APIs.

Share this post


Link to post
Share on other sites
Quote:
Original post by PeteD
However if you look at the ocean screenshot from another person's project the amount of triangles that are being rendered and manipulated (moved up and down) is very high. I want to know how it's possible to render and manipulate that many?

To manipulate those huge numbers of triangles it's best to do it using a vertex shader (on the GPU) rather than on the CPU.

Share this post


Link to post
Share on other sites
There is an article in the Gamasutra about Deep-Water Animation and Rendering. Also there are some chapters in the GPU Gems series. You can take a look of them.

Share this post


Link to post
Share on other sites
http://graphics.cs.lth.se/theses/projects/projgrid/ gives some nice results for rendering water with a high vertex count

Share this post


Link to post
Share on other sites
One thing to consider is that you also don't have to actually render all the detail. You can use bumpmapping to add detail to the waves, without actually having to incrase the complexity. I don't think that Ogre screenshot is actually renderng all those small triangles for the waves (if you look, they are uniform like a flat plane along the ground), it looks more like it's animating the larger triangles per vertex (for actual depth in the scene), then applying a bumpmap to add the minute details.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!