Are there any nodes in the material editor with like absolute world position, but without the rotation factor?

I have a water material I have made. I am using absolute world position to keep it from scaling with large planes. I now realize I would like to quickly change the flow direction by just rotating the plane. Is there any node like AWP that does not include the rotation factor? If not, what’s the easiest way to achieve the result I am looking for? Thank you.

Hi joshezzell -

There is not an absolute world position without the rotational factor, it is built into the returned vector that the node gets you. I would however, suggest using a controlled panner and a blueprint to control teh flow of your river. All you would need is to set a base speed into two panners one which pans along the U and the other along the V. The using a Scalar Value multiplied by Time into each one you can completely control the flow in whatever direction you could want simply by manipulating the values of the U and V Scalar inputs moving from -1 to 1. Here is what the Material setup would look like with a very simple water texture:

I have two scalar values called U_Flow_Control and V_Flow_Control which can be controlled through blueprints via a Dynamic Material Instance assigned to your River Plane. You could also set up a relationship between the rotation of the plane and the values being feed into these scalars for even easier control, this would be done in the Construction Graph.

I also might use a Material Parameters groups for those FLow Control variables to make it that much easier to change in the Blueprint.

Let me know if I can help you further -

Eric Ketchum

Eric, thank you. This information was helpful. I was able to split up my 3 panners to each have a flow control. I haven’t tried the blueprinting yet, although I don’t know if our team currently needs blueprinting implementation for our rivers.

I do have a problem though, I can’t use this method on streams at an angle. This is one of the reasons I wanted to rotate my planes. Having control on a winding river like this is incredibly useful, but with this method I can only tell it to go forward or backward. Is there a way to rotate the texture coordinates somehow? I don’t know of every node in the material editor yet, so I might be thinking of something that does exist.

The only way I can see doing this is inside the panner itself. A value of 0 in Speed x and -1 in speed y gives me a downstream effect. If I want it flowing to the side some, I add some to speed x (+ or - depending on what direction). I just find this tedious though. I also wanted to use the same instance for most types of water, doing this means I have to make multiple materials for different directions of flow.

Sorry, I just had another thought. Flow maps. I only learned they existed when I saw the effects cave demo. I am pretty new to a lot of these techniques. I wouldn’t know where to even start on implementing a flow map, but I have a feeling it may help me?

Hi joshezzell -

Yes, Flow maps would be a great help in getting a truly realistic look to your river. You would need multiple flow maps though offering a unique flow angle and then your material would have to be set up through a series of changeable scalar values to move from one to another.

I would still use flow maps in addition to the setup I gave you earlier. If you change the scalar values of the U_Flow_Control and V_Flow_Control separately you should be able to do a full 360 degree rotation in the 0,1.

Of course all of this depends on how the mesh of your river is set up. I will work up an example with flow maps for you to look up and post as soon as I can.

Thank You

Eric Ketchum

In response to the original question, yes you can apply local rotation to world coordinates.

This is a minor nitpick but the issue was worded backwards. Worldposition already has no rotation information. What you want to do is transform the worldposition by the actor local rotation.

You will need 3 tangent nodes:
1,0,0 transformed from local->world will be your new X
0,1,0 transformed from local->world will be your Y
0,0,1 transformed from local-> world wi ll be your new Z.

Then place a matrix 3x3 transform material function. The above 3 things go into X,Y,Z obviously (I probably swapped two of the directions though, might have to play with that), and worldposition goes to “vector to transform”. Basis position should be left blank or 0.

You could also try transforming worldposition into tangent space by instead using tangent x, y and vertex normal as the Z.