|
created [UDK] Zelda Water Shader Help
on 04-30-2012 01:41 PM
Hey,
I have another interesting challenge for you folks on Polycount. It helps if you're familiar with the the game in the title but I'll provide a gif of a waterfall below. I'm trying to recreate this flowing water effect and I'm wondering if you can help me nail the material network down. Obviously we have a panner for the middle section but it's the pointy bits at the top and bottom that have me puzzled.
I look forward to seeing the replies.
|
, dedicated polycounter,
1,465 Posts,
Join Date May 2010,
Location England, a quaint little town just outside London. About 40 minutes away from Moorgate.
|
I think it's just a horizonal panner with a tiling wave texture on it layed over using another alpha plane. Vertical waves offset could be done with some kind of vert painting shader. Can't rememther the ins and outs of it, but it looks like this!:
Or it's just an angled alpha plane with another panner on it wedged into the edges.
|
, dedicated polycounter,
1,670 Posts,
Join Date Dec 2010,
|
Hey, this is just one tileable texture for the water flow, the edges on top and bottom are just probably animated textures with alpha. The corners also have animated white water alpha going on. I dont think there's much secret about it. Specially that this game is unlit the whole way, or just vertex painted. Still lovely game, I miss it.
|
, dedicated polycounter,
1,479 Posts,
Join Date Feb 2006,
Location Redmond WA
|
How I'd do it:
Panner->Rotator (or vice versa)->mask channel R->a noise/clouds texture->take one of the channels->use IF against the G channel of our UVs->white or blue.
|
, polygon,
661 Posts,
Join Date Nov 2011,
|
I was bored so I got out my laptop (which can barely run UDK) and roughed the edging and as a bonus the splash at the bottom.

It's not exact but not far off.
I'll upload the package in a bit.
|
, polygon,
661 Posts,
Join Date Nov 2011,
, polygon,
661 Posts,
Join Date Nov 2011,
|
Thank you so much. You're going in the credits of my project when it's done.
|
, dedicated polycounter,
1,465 Posts,
Join Date May 2010,
Location England, a quaint little town just outside London. About 40 minutes away from Moorgate.
|
I just want to say man that the water fall you got going is still awesome, looks like a good and fun project can't wait to see more.
|
, card carrying polycounter,
2,402 Posts,
Join Date Jan 2005,
|
you could always just use a flipbook texture for that true .gif feel... 
|
, vertex,
27 Posts,
Join Date Apr 2012,
Location Blackburn, England
|
What is the bit of code in the custom node doing? I don't quiet understand. How is it bending the U and V into a radial?
Can you break down what each part of the equation is for? I'm mostly curious as to what the atan2 is.
Last edited by Gannon; 05-03-2012 at 10:09 PM..
|
, polygon,
727 Posts,
Join Date Dec 2008,
Location Montreal,Quebec
|
Atan2 takes a X and Y and returns the angle around 0 as -pi to pi. I'm also doing some addition/multiplication in there too just to get the scales/offsets right.
|
, polygon,
661 Posts,
Join Date Nov 2011,
|
You guys are totally overthinking the Zelda water. Those "spikes" are just two copies of an alpha mask, scrolling in opposite directions. The mask image is low frequency waves, with a few larger "spikes" in it. As the two scroll, the "spike" waves cross over, causing the bigger spikes. You can really see it if you pick a spot in the scroll and follow it with your eyes as it pans - it will reveal the two layers.
Keep in mind, the Gamecube used very limited pixel shaders. It wasn't very fast. Computing arc tangents per pixel would likely be prohibitively expensive on an actual Gamecube.
While that doesn't apply as much to today's graphics processors, it's a good idea to keep up the same mindset. The more reuse you can get out of your shaders, the better off you'll be. You don't want infinite different shaders for every new object or effect, for the sake of batching, resources, etc.
If you can accomplish something with a simpler shader, do it 
|
, veteran polycounter,
3,638 Posts,
Join Date Jul 2005,
Location Texas
|
You could quite easily work around the atan using a triangle fan. If you look at the slight segmentation on the ripple that's probably how they did it.
|
, polygon,
661 Posts,
Join Date Nov 2011,
|
Quote:
Originally Posted by Slum
You guys are totally overthinking the Zelda water. Those "spikes" are just two copies of an alpha mask, scrolling in opposite directions. The mask image is low frequency waves, with a few larger "spikes" in it. As the two scroll, the "spike" waves cross over, causing the bigger spikes. You can really see it if you pick a spot in the scroll and follow it with your eyes as it pans - it will reveal the two layers.
Keep in mind, the Gamecube used very limited pixel shaders. It wasn't very fast. Computing arc tangents per pixel would likely be prohibitively expensive on an actual Gamecube.
While that doesn't apply as much to today's graphics processors, it's a good idea to keep up the same mindset. The more reuse you can get out of your shaders, the better off you'll be. You don't want infinite different shaders for every new object or effect, for the sake of batching, resources, etc.
If you can accomplish something with a simpler shader, do it 
|
QFT
EDIT:
OK what I would do more specifically, is use a lerp to separate the flowing water texture, and constant3V for the solid color.
For the Alpha for the LERP, I would use an RGB texture, no alpha, and place my jagged masks in the R and G, and use the B for the edges. Pan those R and G channels into a multiply, then plug the multiply into the lerp alpha.
Last edited by King Mango; 05-04-2012 at 10:47 AM..
Best regards,
King Mango
|
, spline,
184 Posts,
Join Date Aug 2008,
Location Los Angeles
|

How about this? No ifs, no atans, just one texture sample and some scrolling with a multiply for falloff, the mapping to a "tunnel" shape done by a triangle fan.
|
, polygon,
661 Posts,
Join Date Nov 2011,
|
This gives me an idea for contests, we should have mini shader comps on who can do a shader with the least instructions, and who can do the best looking one with a maximum limit.
|
, polycounter, lvl. 13,
7,244 Posts,
Join Date Jul 2009,
Location Columbus Ohio
|
Hey guys, I did it.
Texture sources:
Waterfall BG
http://i.imgur.com/evAPk.png
Current 1
http://i.imgur.com/Gl1ZQ.png
Current 2
http://i.imgur.com/lGiUj.png
Splash
http://i.imgur.com/Jdv9M.png
Here's the whole material
He's the branch that repeats 5 times (I just copied it from JamesWild), 3 of them have different uv sets, the 2 current ones over lap and use the same UV, different speed, the top splash is 2 splashes going in opposite directions and mirrored.
And this is how it is all put together in the end
Any questions?
Last edited by ZacD; 05-04-2012 at 09:53 PM..
|
, polycounter, lvl. 13,
7,244 Posts,
Join Date Jul 2009,
Location Columbus Ohio
|
It's nice ZacD, except for the parts at the top and bottom. I can notice the textures panning, where in the original, it's more "wavy" instead of "panny". If you could tweak it a bit, it would be awesome.
|
, polycounter,
1,118 Posts,
Join Date Dec 2006,
Location Los Angeles
|
I believe, in the original there is a separate mesh on top of the 2 meshes going opposite directions, that causes those big bouncy spikes, but there is also the 2 crisscrossing textures like I have. I could try to add a third layer to the spikes, and tone the 2 I have down a bit, and there's also some vertex offset going on in the actual game as well. Before doing anything more to the material I'd want to jump in game, and it'd also depend on the scene I was creating.
|
, polycounter, lvl. 13,
7,244 Posts,
Join Date Jul 2009,
Location Columbus Ohio
|
Hah I never expected this to continue.
Hey James, could I be cheeky and ask how you would do the wind effects? It's a sort of single line with points at both ends. In other words it's a scrolling, fading white texture with points on each end. I'd get a video but there's not one that really shows it. You have to look up a video of gameplay.
|
, dedicated polycounter,
1,465 Posts,
Join Date May 2010,
Location England, a quaint little town just outside London. About 40 minutes away from Moorgate.
|
I did play Wind Waker end to end a few years ago (actually the only Zelda game I like a LOT) and I think I know the one you're talking about. Could probably pull it off with a white emissive, and two multiplied very small images. Hang on...
|
, polygon,
661 Posts,
Join Date Nov 2011,
, polygon,
661 Posts,
Join Date Nov 2011,
|
Thanks man! I look forward to sharing what I've applied your shader to but there's still a few things left to do before I can showcase it.
|
, dedicated polycounter,
1,465 Posts,
Join Date May 2010,
Location England, a quaint little town just outside London. About 40 minutes away from Moorgate.
|
Hey again, sorry to be a pain but your wind effect is almost there but not there. Well in regards to speed anyway. I've messed around with the numbers but I can't get the perfect speed, flow and fade.
Here's a video of the wind, check 5:16 in the background and I suggest you mute, loud mouth guy playing. Look behind her head for example, speed and fade.
On the bright side you can scale the static mesh along the z axis to make it thin like in the vid.
Last edited by Habboi; 05-07-2012 at 01:29 PM..
|
, dedicated polycounter,
1,465 Posts,
Join Date May 2010,
Location England, a quaint little town just outside London. About 40 minutes away from Moorgate.
|
Also don't forget to oscillate the spikes in the light blue jaggies. Notice they are pulsing up and down which helps to hide the panning effect.
Best regards,
King Mango
|
, spline,
184 Posts,
Join Date Aug 2008,
Location Los Angeles
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Copyright 1998-2012 A. Risch
|