Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1] 2
  Print  
Author Topic: Reflective Water Sample Refreshed  (Read 34646 times)
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« on: December 10, 2006, 12:07:42 AM »

Heya!
I'm currently in the process of refreshing my water sample. I said I'd do it some time, so now I had a *little* free time and will so I got to it. Smiley

Changes currently include :
- 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

Planned change before release :
- Alpha-blending on the shores... maybe auto-generation of the alpha map like Mietze did back then?
- Procedural mip maps generation for the normal maps, because the traditional way makes all the details disappear in the distance... D:
- VB.Net version
- Maybe a refraction option?

And obligatory screenies :







Coming soon!
Logged

BlindSide
Customers
Community Member
*****
Posts: 760


« Reply #1 on: December 10, 2006, 01:37:24 AM »

Looking forward too it!
Logged
Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #2 on: December 10, 2006, 05:47:20 AM »

Quote from: "Zaknafein"
Alpha-blending on the shores... maybe auto-generation of the alpha map like Mietze did back then?
Feel free to do it Smiley The auto-generation is very simple, but clamping it on the waterplane to make it fit the terrain-size is much more complicated - at least if you have more then only one landscape Smiley
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Rynus_Rein
Community Member
*
Posts: 1008


« Reply #3 on: December 10, 2006, 07:42:16 AM »

I see the general FPS is also higher now?
Logged

Rynus Rein
Current Project: MapX Live, Society3D
Massive
Customers
Community Member
*****
Posts: 58


WWW
« Reply #4 on: December 10, 2006, 09:21:44 AM »

I can't wait to get round to trying your water n sky shader stuff soon zak, now that I have an SM2/3 card and can enjoy such luxuries Smiley
Logged
pizzayoyo
Customers
Community Member
*****
Posts: 1423


WWW
« Reply #5 on: December 10, 2006, 11:22:15 AM »

Thanks for this update, Zak. It should be super-easy to add your water shader to a project now Cheesy
Logged

Eric
Customers
Community Member
*****
Posts: 808


« Reply #6 on: December 10, 2006, 12:18:04 PM »

Really looking forward to this - I was re-looking at your sample the other day and thinking about putting it into one of my projects.  Now it sounds like it will be easier than ever Cheesy
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #7 on: December 10, 2006, 05:53:41 PM »

Thanks all! I should be done with the demo in a week or so...

Quote from: "Rynus_Rein"
I see the general FPS is also higher now?

That might be a coincidence, or me running the sample on a better GPU, or without FSAA. Tongue

Quote from: "Mietze"
at least if you have more then only one landscape

Mmmyeah, that looks like a "special case" I won't handle in the demo. In fact the alpha map generation will be in a seperate app, since it would normally be handled in the game's editor.
Logged

Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #8 on: December 11, 2006, 12:42:34 AM »

Quote from: "Zaknafein"
Quote from: "Mietze"
at least if you have more then only one landscape

Mmmyeah, that looks like a "special case" I won't handle in the demo. In fact the alpha map generation will be in a seperate app, since it would normally be handled in the game's editor.
Thats true. The basic algorithm for this is very very easy. If you wanna deal me, i could tell you some more details.
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #9 on: December 12, 2006, 01:21:53 PM »

A little update on my progress... :
I worked on the mip-mapping imprecision issues. I thought the reason why my volume map was so "static" and flat in the distance was because I was calculating my normal maps wrong, based on what I had read in this GDC presentation.

So like this presentation suggested, I started using the "Normal Map Options" section of the DDS saving dialog of the nVidia Photoshop plug-in instead of NormalMapFilter. It works great, and it's so much more natural to work this way!
Edit : Lengthy explainatory post here : http://www.truevision3d.com/phpBB2/viewtopic.php?t=14288

To be able to use that work flow, I needed something to "disassemble" my volume normal map into slices, then regenerate the normals on them, and "assemble" the slices to a volume texture back again with all the mip maps. I didn't find any easy tool to do that, so I figured I'd give it a shot in Managed DirectX.

It wasn't easy, but it works!



While making that application I found out one fundamental thing about volume textures... They're mip mapped in ALL dimensions.
That means that a 512x512x16 file will have a mip level 1 of 256x256x8 and NOT x16. For animations stored as volume textures, that means HALF the number of frames...
Edit : This issue/detail is now wikified!!1 : http://wiki.truevision3d.com/hlsl_intrinsics#texture_types

So the normal maps were better looking in the end, but I still have the volume texture problem. The only way to attenuate it is to make much more frames (the texture already weighs like 11 megs!) or to make the texture smaller, like 256x256.
I made a quick try, with promising results. I'll put both versions of the texture in the final demo so you can make your choice : more definition and less animation, or less definition with better animation.

Next on the list is the alpha-map stuff! Also I discovered a bug that made the non-parallax mapping mode of the shader fubar with dual-lookup mode. I'm going to fix that as well.
Logged

Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #10 on: December 14, 2006, 07:42:50 PM »

Had a bit of fun and merged the sample with my recent Bloom sample... Sexyness ensued.





Logged

pizzayoyo
Customers
Community Member
*****
Posts: 1423


WWW
« Reply #11 on: December 14, 2006, 08:11:48 PM »

Looks really cool! Especially the 2nd pic. Keep it up Smiley
Logged

BlindSide
Customers
Community Member
*****
Posts: 760


« Reply #12 on: December 15, 2006, 01:37:01 AM »

Nice work!
Logged
Waterman
Moderator
Community Member
*****
Posts: 1159


« Reply #13 on: December 15, 2006, 03:04:52 AM »

Zaknafein, nice work.

Hint: Try to use POINT filter when sampling the sky reflection.
Logged

Things should be described as simply as possible - but not simpler [A. Einstein]
jviper
Community Member
*
Posts: 2131

Discipline in training


« Reply #14 on: December 15, 2006, 12:01:41 PM »

I hope you will have a running demo of this. Hopefully, I will be creating scenes that look like that  :wink:
Logged

JAbstract.....Don't just imagine, make it happen!
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #15 on: December 15, 2006, 01:21:15 PM »

Quote from: "Waterman"
Hint: Try to use POINT filter when sampling the sky reflection.


I'm surprised that this looks good, but it does. Cheesy
In fact it just doesn't look worse than Linear/Anisotropic, and it's a tad faster. Thanks!
Logged

Waterman
Moderator
Community Member
*****
Posts: 1159


« Reply #16 on: December 15, 2006, 07:24:54 PM »

It depends, really, sometimes you particularly want the sparkles while at other times, with different weather, lighting etc. conditions, it just makes the water surface the bad thing we want to avoid with filtering.

Would actually be nice if one could change the hw filtering without re-creating the shader. Haven't tried that, perhaps it's possible somehow...?
Logged

Things should be described as simply as possible - but not simpler [A. Einstein]
rootsage
Customers
Community Member
*****
Posts: 444

Gamer Enthusiast


WWW
« Reply #17 on: December 28, 2006, 11:24:41 PM »

Bumpie Bump...

How's this project going Zak? Is this still using your original water shader? I am interested in dissecting your code Cheesy
Logged

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


WWW
« Reply #18 on: December 29, 2006, 12:02:56 AM »

Uuuh yeah, I got sidetracked on other projects like the sky gradient thing and a plug-in system for pizzayoyo...
I'll get back to this sometime soon.

And yup it uses the same base code as the original water sample. The shader is almost identical, but the sample code itself is greatly improved.
Logged

rootsage
Customers
Community Member
*****
Posts: 444

Gamer Enthusiast


WWW
« Reply #19 on: December 29, 2006, 04:00:46 PM »

Cool cool, i'll keep checking back then. Cheesy
Logged

while( !( succeed = try_again()) );
------
10 print "Is this recursive?"
20 goto 10
Pages: [1] 2
  Print  
 
Jump to:  

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