Tuesday 3 July 2012

Generic XNA - Water



Yes, I know, I have already put up the NVIDIA ocean shader, but after a member of the community had some issue with it, mostly how it played with the SkySphere sample I found that in my naive XNA days (I know, I am still learning) I made a shed load of errors in the implementation of the class. This I am going to remedy in my next post, so expect the Ocean Shader II post to be next.

During my investigation of the issues David Reilly was having with the combination of Ocean and SkySphere I came across a water shader that I found ages ago. I cant for the life of me remember where I got it from, but I am glad I found it. It's written by Anirudh S Shastry and it does all the stuff the NVIDIA shader does but I personally think that it has better performance. I guess putting them both up here gives you the choice when it comes to water shaders. I also plan to come up with my own water shader at some point, but for now here are the third party shaders I have.

As far as the shader goes, I have not changed much, there was a redundant routine or two, but other than that it is pretty much as I found it. As with the NVIDIA shader, all I have done is provided an XNA class that gives access to the shader and it's parameters.

Hope you find it useful. Solution can be found here.

No comments:

Post a Comment