Jump to content
  • Advertisement
Sign in to follow this  
MeshMan

HLSL Water

This topic is 4809 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

Hi guys, I've been trying to implement Humus's water sample that he has on his site (www.humus.ca) for the last 2 days and I can't get it to work. Its a version of refractive/reflective water using a cube map but my water wont reflect anything or animate, so I'm sorta giving up until my shader book gets here. Meanwhile, can anyone supply me with a .FX shader for nice simple water? Or point me to some tutorial/demo that shows off a nice 'simple' water shader :). I've googled and googled and there doesn't seem to be much HLSL stuff on the web. Thanks, Meshman

Share this post


Link to post
Share on other sites
Advertisement
Never tried Humus's, but there are sample HLSL water effects for both FXComposer and RenderMonkey (both programs are free downloads from Nvidia's or ATI's respective sites).

I have tried Nvidia's Ocean.fx before, and it is a very nice looking effect.

There are also some great ideas in the GPU Gems and ShaderFX series.

...

While we're on the subject, however, I have yet to find a great volumetric cloud shader... :)

Share this post


Link to post
Share on other sites
Quote:
Original post by The Frugal Gourmet
I have tried Nvidia's Ocean.fx before, and it is a very nice looking effect.

Ah yes, that is a great ocean shader.

Quote:
There are also some great ideas in the GPU Gems and ShaderFX series

In ShaderX2, there is an awesome water article (it looks more like lake or pond water more than ocean water). Even though it is over a year old now, it still looks great compared to the latest stuff out there.

Quote:
While we're on the subject, however, I have yet to find a great volumetric cloud shader... :)

Have you visited Mark Harris' site? It is the *ultimate* cloud rendering resource. His methods are quite intensive, but they can be watered down for use in a standard game. Game Programming Gems 5 has a good article that does this.

Share this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
Have you visited Mark Harris' site? It is the *ultimate* cloud rendering resource. His methods are quite intensive, but they can be watered down for use in a standard game. Game Programming Gems 5 has a good article that does this.


I stumbled onto that site not long ago, and I thought the clouds were *amazing*. But, looking at the source it seemed like a substantial effort for me to reproduce something similar in my own engine (which is mainly Managed DX w/ shaders). I was hoping to find something that would guide me from an angle I'm already somewhat comfortable with. :) I will definitely check out the GPG article... thanks.

Share this post


Link to post
Share on other sites
I guess I'm not good enough yet then guys cuz looking at the Ocean shader from NVidia, it looks like an absoloute nightmare and I don't know where to start with it in terms of implementing it.
I've just begun to use shaders and so far all I can do is draw a transformed textured non-lit mesh as you can with the fixed function pipeline. I was hoping to find a simple PS/VS 1.1 compatible water shader but obviously nothing for that is around no more.
Thanks for the responses.

Share this post


Link to post
Share on other sites
Quote:
Original post by MeshMan
I guess I'm not good enough yet then guys cuz looking at the Ocean shader from NVidia, it looks like an absoloute nightmare and I don't know where to start with it in terms of implementing it.
I've just begun to use shaders and so far all I can do is draw a transformed textured non-lit mesh as you can with the fixed function pipeline. I was hoping to find a simple PS/VS 1.1 compatible water shader but obviously nothing for that is around no more.
Thanks for the responses.


Well, Ocean.fx is definitely a bitch to start off with. It incorporates a lot of water concepts and math. It also requires generating binormals and tangents and you have to build a 3D object similar in form to the one they use in the sample.

I'll let you know if I come across a more straightforward water shader. Try out the ones in RenderMonkey (another free program) if you get a chance.

Share this post


Link to post
Share on other sites
Quote:
Original post by The Frugal Gourmet
I'll let you know if I come across a more straightforward water shader. Try out the ones in RenderMonkey (another free program) if you get a chance.

Unfortunately, water is one of the hardest natural objects to model well, due to its complexity (both visual and mechanical). Not only are its physics difficult to simulate, but its appearance is incrediby hard to get right. Our real-time methods consist of eye candy that simply look good.

Luckily, water is one of the most sought-after effects, so a lot of research has been poured into it. For this reason, there are a lot of resources out there on it - but due to its complex nature, there aren't many applications out there that are both simple and visually stunning.

Share this post


Link to post
Share on other sites
note the ocean.fx file has two pixel-shaders. The on used as-is is quite complex, but the second one, which is never called, is much simpler.

That would be a nice place to start from. I've learnt most of what I know about HLSL from that single effect, I'd say putting the time to understand it is well worth the time spent.

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!