Jump to content
  • Advertisement
Sign in to follow this  
davedx

Rendering seas

This topic is 5093 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 working on a game that will be using a lot of 'on the high seas' kind of scenes. We're hoping to render 'stormy seas' and 'calm seas'. Most of the action will be in the middle of the ocean rather than coastal, so think larger, smoother waves - but of course, the sea isn't that simple by any means, unless it's really flat and calm. Anyway. So far I have an undulating mesh, where the y (height) values of each vertex are deformed according to a sin function. It's a pretty good start, but is nowhere near as nice looking as I want it to be. Basically I'm aiming for graphics like Far Cry (though less emphasis on reflection and more on wave shapes/patterns), or Pirates XXI Century. I've tried experimenting with pixel shaders, with the intention to implement specular lighting on the waves from the sun. Unfortunately, I got a horrible frame rate when I rendered with a really simple pixel shader; definitely partly because my graphics card is a crappy laptop onboard, but also I'm theorising, because the fill rate is prohibitive. Does that sound right - is using pixel shaders on a really large area of the screen a bad idea? Are they better suited to small details here and there? Finally, does anyone have any suggestions or links I could look at regarding rendering real-time waves - preferably not the transparency/reflectivity of land features side of things, since that's not really what I'm focusing on. :) Thanks a lot!

Share this post


Link to post
Share on other sites
Advertisement
Do you mean, if my card supports pixel shaders in the hardware, the fill rate won't slow them down much? So it's just because I'm using software emulation that they're horribly slow?

It seems like a big problem if that's the case though; the game isn't targetted at top-end platforms.

Share this post


Link to post
Share on other sites
I don't know pixel shaders (that is, I've never worked with them), but I think that a such powerful feature should be targeted to only those cards that support it. Perhaps it would be better to provide a simple sea version for older cards, and an advanced one for newer ones.

Share this post


Link to post
Share on other sites
A shadow map blur algorithm I coded did like 20 fullscreen passes per frame with fairly complicated (50-60 instructions, lots of dependent texture reads) ps2.0 pixel shaders and still got something like 5fps on Radeon9700pro. So yeah, pixel shader to render a sea surface would be fine.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
As for the geometry - fractals can be a very good choice if you're looking for realism.

Share this post


Link to post
Share on other sites
Maybe I'm just going blind, but I spent the last half hour browsing both sites and couldn't find anything on rendering oceans. Not helped by the fact ATI's search engine keeps timing out, grumble.

Fractals sounds like an interesting way to do it, I'll look into that, thanks. :)

Back to [google] now then! :D

Share this post


Link to post
Share on other sites
Damn, so many implementations I've found rely on programmable shaders.

Is it possible to do specular lighting without pixel shaders in DirectX?

Sometimes I miss the days of direct video memory access :/

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!