Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1] 2 3 ... 6
  Print  
Author Topic: Zak's Ocean Shader Freely Downloadable [6.5]  (Read 112187 times)
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« on: May 12, 2006, 11:35:26 AM »

New version as of July 7th 2007 :
- Much better interface, to see the different effects without touching the shader
- Self-contained Water class which would work alone in any TV3D project as-is (really!)
- Fixed fog support for all shader models and fog types (it never actually worked in SM3.0 before)
- Overall cleaner code
- Bloom!
- Lyon/Blinn specular reflections for long grazing specular highlights.

See the in-development thread for more information.

I will not update this sample anymore. That includes ports, enhancements, new features, fixes, optimizations, name it.

Also, I have seen someone on an XNA forum that used my code and textures to build his water shader and claimed it its own. I'd really like it if anyone that uses it would at least credit me (i.e. place my name somewhere, do not appropriate my work). Also I did mention below that the textures were made using trial software, and cannot be used in a commercial project!

New version as of August 1st 2006 :
- Better specular reflection;
- Fog support for both SM2.0 and SM3.0;
- Foam sprays can be disabled with a shader pre-processor (#define);
- Recompiled with newest TV6.5 DLL;
- Cleaned the codebase a little, easier to understand and to play with.

New shots :




---

Finally, I've decided to make my shader open-source and free for everyone.

But I have one thing to ask you. Do not just take the shader and fit it in your app like a plug-in. There are TONS of customizations possible with the parameters, constants and compilation flags in the shader and in the code, play with them, adapt the shader to your tastes, or even better, learn HLSL and optimize it to your needs!!
The constants should not normally be changed, but you can play with them. The parameters are the things you want to play with in normal circumstances.
And of course if you have artists in your team or are one yourself, try to make other wave parallax maps to see how it'd look like... Smiley

The shader code is fully commented so it should be readable. I commented the TV3D code a bit too.
I optimized it as much as I could considering how versatile it is. The simplest configuration takes only 34 pixel shader arithmetic instructions, but the worst-case takes 50 (which makes it compatible SM2.0). I still think it's a very usable shader in a game environment.

Edit : The 3D parallax map (shown in the screenshots) was made using a trial version of CGSD's Bump Texture Tools, so I guess you wouldn't be allowed to use it in a commercial project. You'd need to pay for the app or make your own with another program. I've tried a couple of alternatives (Texture Maker generators, Photoshop clouds and noise) and this prorgam made the best seamless heightmaps.

You should know that this water is great when there's nothing that collides with it, since it's just a water plane (very little polygons) and there is no vertex displacement in the vertex shader. All "depth" effects are done via parallax mapping in the pixel shader. That means that a boat on the surface of a water plane like mine would never have slopes to climb or fall from.

--

And the download link : http://zaknafein.hjcrusaders.com/samples/Water/Water.rar (9 Mb)
Logged

newborn
Customers
Community Member
*****
Posts: 2451


WWW
« Reply #1 on: May 12, 2006, 12:24:48 PM »

:shock: tabern!
Logged

WEst
Customers
Community Member
*****
Posts: 945

Daniel Martinek


WWW
« Reply #2 on: May 12, 2006, 12:35:44 PM »

omg, i think I'm dreaming  :shock:
Logged

Greetings

Daniel Martinek
Technical Director
23 Volts
AriusMyst
Guest
« Reply #3 on: May 12, 2006, 01:04:13 PM »

Thanks Zak, I was hoping you were gonna release this. It will be very educational for me in my HLSL learning.  Smiley
Logged
Migajek
Community Member
*
Posts: 316


« Reply #4 on: May 12, 2006, 02:50:19 PM »

Amazing, as always Wink
Logged

Oxygen
Customers
Community Member
*****
Posts: 127


« Reply #5 on: May 12, 2006, 02:55:24 PM »

I think it's time to add water to my engine. This water is top notch IMO. Thank you for your contribution.
Logged
rootsage
Customers
Community Member
*****
Posts: 444

Gamer Enthusiast


WWW
« Reply #6 on: May 12, 2006, 04:44:43 PM »

YES!!! Thank you Zak, you are awesome! Cheesy I'm so happy I have a awesome shader to play with now...

-Eric
Logged

while( !( succeed = try_again()) );
------
10 print "Is this recursive?"
20 goto 10
phether
Customers
Community Member
*****
Posts: 425


« Reply #7 on: May 12, 2006, 08:15:55 PM »

One Word.

Drool!

As always Zak. Nice Job!
Logged

Birds of a phether...
Code with pride not ego!
Raine
Customers
Community Member
*****
Posts: 1212


« Reply #8 on: May 12, 2006, 08:45:15 PM »

Thanks, and thanks, and thanks again! Cheesy
Logged

darqSHADOW
Administrator
Community Member
*****
Posts: 2817


« Reply #9 on: May 12, 2006, 10:28:15 PM »

Just tested on my system and I manage to hover right around 300fps with one video card, and over 450ftp average when in DualSLI mode.  Cheesy  Good work, Zak, and an amazing sample for people!

DS
Logged

TrueVision3D Project Manager
The fast and simple way of 3D development.
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #10 on: May 12, 2006, 10:30:46 PM »

Excellent DS! Cheesy I was a little worried about performance, that's good to hear.

And thanks alot everyone!! Do ask if you have questions about the sourcecode or implementation, etc...
Logged

darqSHADOW
Administrator
Community Member
*****
Posts: 2817


« Reply #11 on: May 13, 2006, 11:12:47 AM »

This is not the thread to complain about 6.5 not being out.  So don't start.

DS
Logged

TrueVision3D Project Manager
The fast and simple way of 3D development.
Happy
Customers
Community Member
*****
Posts: 78


« Reply #12 on: May 14, 2006, 05:29:53 PM »

:shock:  OMG Zak Awesome work!!!  I have only a geforce FX 5500 (need to upgade soon) :lol:, but i was exspecting like 7-10 fps... nope I hit around a good 29 looking down at the shader, and  40-45 moving across it  im very impressed man TV is extremely fast, ima look into shaders now thanks. Smiley
Logged
Dan
Customers
Community Member
*****
Posts: 707


WWW
« Reply #13 on: May 15, 2006, 07:50:44 AM »

Blimey Zak, Like it or not I think your going to be stuck with the King of shaders title! Thats a very impressive sample, Thank you for providing source code Smiley
Logged
oconnellseanm
Community Member
*
Posts: 53


« Reply #14 on: May 15, 2006, 10:31:25 PM »

Do you have to have Truevision3D 6.5 to run this?  I tried running it and it crashes.  I then debugged it in VS 2005 and it said it was missing Truevision functions.
Logged
rootsage
Customers
Community Member
*****
Posts: 444

Gamer Enthusiast


WWW
« Reply #15 on: May 15, 2006, 10:34:21 PM »

Yep, check the title of the post "Zak's Ocean Shader Freely Downloadable [6.5]"

Cheesy
Logged

while( !( succeed = try_again()) );
------
10 print "Is this recursive?"
20 goto 10
tweakbox
Customers
Community Member
*****
Posts: 1194


« Reply #16 on: May 15, 2006, 11:02:38 PM »

Quote from: "Happy"
:shock:  OMG Zak Awesome work!!!  I have only a geforce FX 5500 (need to upgade soon) :lol:, but i was exspecting like 7-10 fps... nope I hit around a good 29 looking down at the shader, and  40-45 moving across it  im very impressed man TV is extremely fast, ima look into shaders now thanks. Smiley


Hrm, I've got a 4800+ dual core cpu, 2 gigs of very high-performance memory, and an ATI Radeon X1900XT 512 meg graphics card, complete with 48 pixel processing pipelines, and in both windowed and fullscreen I get around 35 FPS max, with 22 or so when I look right down at the water.  I'm fairly sure I've turned off all the happy settings in the graphics card drivers, but there's a bunch of happy settings in that thing, so I may have missed one.

Seems like I should be getting at least a few more FPS out of it though...
Logged

I want to make a puzzle with like 40,000 pieces, and when it's done, it says "Go Outside"
rootsage
Customers
Community Member
*****
Posts: 444

Gamer Enthusiast


WWW
« Reply #17 on: May 15, 2006, 11:10:45 PM »

I have a 4800+ Dual Core, 2 Gigs of Corsair XMS RAM, and 2 7800GTX running in SLI and I get 550 - 600fps. It has to be the config of your card tweakbox.
Logged

while( !( succeed = try_again()) );
------
10 print "Is this recursive?"
20 goto 10
Oxygen
Customers
Community Member
*****
Posts: 127


« Reply #18 on: May 16, 2006, 01:14:10 AM »

This is fantastic!

I'm not getting reflections though, haven't found any errors relating to it.

edit: nevermind, I wasn't trying hard enough. Looks great!
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #19 on: May 16, 2006, 06:25:44 AM »

Quote from: "tweakbox"
Hrm, I've got a 4800+ dual core cpu, 2 gigs of very high-performance memory, and an ATI Radeon X1900XT 512 meg graphics card, complete with 48 pixel processing pipelines, and in both windowed and fullscreen I get around 35 FPS max, with 22 or so when I look right down at the water.

That's odd... Try enabling TV's profiler and check what's taking the most time to render. It'll probably be the waterMesh.render, but just to make sure.
And I don't know how well my shader reacts with anti-aliasing and very high anisotropic filtering on. Make sure you've got that turned off.
Or last resort, try disabling some compilation flags in the shader, like parallax-mapping and detail normal-mapping. Mostly those two.
Logged

Pages: [1] 2 3 ... 6
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks