Flatten shader?

Started by digitalis99, March 13, 2012, 12:15:48 AM

Previous topic - Next topic

digitalis99

I've been beating myself up over this one and have yet to figure out a way to do something that seems to be easy.  I have a very complicated blue node animated wave setup as some of you have seen.  It's tripled in complexity as I've added shore wave ballooning and moving reflective masks to represent the dampness of the receding water line.

In order to pull off the moving reflective mask, I have to take a shader that is colored correctly (white at wave crests and black in the troughs) and remove all Y components from it, effectively flattening it to a 2D image.  I've tried combining it with a Y-inverted displacement, multiplying various displacement functions by a Y of 0, and a bunch of other stuff that was equally unlikely to work.  Nothing I do removes the Y displacement of this shader.

Does anyone know how to do something like this?
Pixel Plow :: Render Endlessly :: http://www.pixelplow.net

ajcgi

Might be slightly confused by what you need but...
Could you use a merge shader in there somewhere and disable the blending of displacements so only the colour is passed through?
Or are you after nodes that would flatten the terrain for you?

Hetzen

I think it will depend if you are using PFs as a source of your noise (in which case scale the Y up, eg 1000000000), or multiply the Get vector by 1,0,1.

Out of interest, how are you detecting your shore height?

digitalis99

The image being generated is entirely from blue nodes.  The color itself is displaced to match the actual height of the waves, hence, when I combine it with a color shader that contains no Y displacement, it doesn't merge like I need it to merge.  I need to remove all Y displacement from the color shader before it's merged with the other color shader that's already flat.

I'm not actually detecting shore height, as TG really doesn't have any ability to detect where two objects (planet and planet) intersect.
Pixel Plow :: Render Endlessly :: http://www.pixelplow.net

Hetzen

Hrmm. Matching colour to displacement is quite difficult, as the displacement normal will touch different parts of colour space to get its value. I've had a dabble at doing waves, but you seem to have progressed much further than I have. One technique that does solve a few problems I've faced, is by generating a heightfield of the beach area I want waves to interact with, clamping a section of the terrain to be used as altitude below water level, to my water level. Then in the Heightfield node colour tab, I shade by height, then use the gradient produced to drive my wave functions on a seperate sphere or plane. This avoids the Get Altitude issue on two seperate objects. It also gives me a 'flat' gradient that works through altitude.

It's difficult to know how to solve your issue without looking at the node network.

Dune

I think Jon (Hetzen) may well get an answer to your problem, Ty. He knows my surf method and probably also the sinus based surf I believe is from Nicolas Hoffman, so there's no secret for him  ;). I have had some more looks at your file but couldn't figure it out. I hope you will, as it looks stunning!

digitalis99

I gave up on this method.  I finally figured out how to flatten it, but found out that didn't help any.  I needed to either extrude that vertically to make it apply to the slope of the beach where the two would intersect or displace it up from 0Y to the height of the beach at each point that it should.  Basically, it just got 10x more complicated.  Sure would be nice to have a mechanism for determining the intersection between two layers.

I'm using a totally different approach now that will hopefully yield the results I'm looking for.  It's more of a fake than it should be, but I'm afraid it's all TG2 can handle right now.  It can't handle the truth.   ;D
Pixel Plow :: Render Endlessly :: http://www.pixelplow.net

Dune

Sorry to hear that, but you've made a huge step forward anyway. I don't do animation (yet), so I haven't set your file to motion, but having seen the earlier version, this will yield extraordinary footage no doubt.