World Position Offset Mask

Hey there,

I am thinking an effect I am working on could benefit from some world position offset, but I need the bottom 1/4th of the mesh to not be affected. I am trying to create a mask , but it seems I am not connecting the right nodes in the material editor, or not connecting the right nodes correctly. Could someone help me with this?

Thank you in advance!

Hey, not sure if you’ve got the answer but this worked for me!
cd785c604681f1dc2b6744b6df9c1322

Setup

The mask I used

2 Likes

Here is the material funtion for a z gradiant in WP.

Here is an implementation in unreal material graph.

Hope this helps!

giphy

3 Likes

Thank you Mkhize! The graph I had created was essentially the same as yours, but that power node is what I was lacking to really keep it anchored! Working as desired for me now, too.

1 Like

Awesome information! Your material is much more complex that what I was thinking of, but I love seeing what you did. Thank you for your help!

1 Like

Awesome, glad it worked!

I love this advanced version, could you help me understand the logic at the bottom that’s being multiplied with the Material Function?

Yeah, it is extremely easy.

You add the sine node value to the newly-made vector that you additionally add to the absolute position node.

The tricky part is at the end of the operation as you need to subtract all of it with the absolute position node to get only the difference.

This means you are only left with the offset value that you created with the sine node.

You also need to do this if you plan on stacking additional offsets to create something more interesting like in this video tutorial.

1 Like

Adding this trick to the thread too! :sparkling_heart:

As you can see, by using a BoundingBoxBased_0-1_UVW node, you can mask out the B channel (W or Vertical) and adjust the falloff and intensity with a SmoothStep. Double Saturate node to please my OCD hahaha

And also sharing this example from the Slime VFX pack I just created:

As you can see, it’s masking out the intensity for the WPO pretty smoothly!

Let us know if there’s anything else we can help with :gem:

I love this tutorial its so handy haha

1 Like