I'm trying to created a material that can be applied to any object and have a panning rain normal wash down its surface. Basically, I'm trying to make it look like water is running over the object.
A simple solution would be to simply have an additional UV map. However, in this case, I don't want to rely on that for two reasons:
1) It would mean that every model in the game would require an extra normal map.
2) If you have an object that needs to be used in many orientations then in all but one orientation the direction of the flow of water would be wrong.
I would be satisfied with something that looks basically like a cylinder map. So U going around the circumfirance of the object and V going from the top to the bottom. I'm not hugely concerned about the seam that would create because the effect would be subtle.
I'd like to avoid using a vector Transform as that will disable vertex colours (which I want so that the rain effect would be vertex paintable).
Does anyone have any approaches that I could look into? I've already tried the ObejctOrientation node, it was a bust.
Replies
Open up the example night and day transition map in UDK. It has examples of this exact thing.
You should just be able to use a world position node as UVs to make water run downwards.
Panning
Orientation Masks
Normals Blending
Unknown
It seems that the approach here is to create three planar UVW 'projections' and then blend them all together.
I've marked one section as "unknown" because I'm not sure exactly what it does. It seems highly likely that its purpose it to actually create the UVWs that the three different projections use. In fact, as I write this, I suspect that's EXACTLY what they do.
The panning section seems straight forward but it's not terribly clear to me why they did it this way instead of just using a panner.
The orientation masks seem to be creating two greyscale masks, one for the horizontal and the other for the vertical that can be used to control the blending.
The actual blending section does just that with a bunch of lerps.
EDIT: There's a huge limitation with this workflow, of course: Tranform nodes kill your vertex colours. If anyone can think of a way to do this without vertex transform I swear to have / not have (delete as desired) their babies.
Yes - that's what world position node is doing. The other two nodes are to scale the coordinates into a managable size.