Gradient across object local space

I want to make an object disappear from the top to the bottom with a gradient mask.

All similar tutorials about it use UV coordinates for it, but I need it to affect the object independent from the UVs.

Somebody got a few hints about how to make a materials like this?

Found a solution after playing around some more. For anyone needing this:

GradientPosition moves the gradient border along the axis chosen by the Mask.

Man, thank you! That was immensely helpful. I’m still learning the expressions/nodes in the material editor, and this was a huge help. Thank you!

You need to add in an “Add + 100” to the local position or this will only get half, so it’s like an offset.

This right now works relative to the object’s local orientation - the gradient covers from top to bottom on the axis specified, but is local in nature (see the attached image).

Any idea on how to make it work along the world axis, so that the gradient still covers the top to the bottom of the object on the specified axis irrespective of the object rotation value?

@psmyles
This might be what your after. The gradient is local to object position, but independent of object orientation. Gradient direction is driven by mask/world based.

3 Likes

Thanks bro, that works

1 Like