# How to mask-out a vertex normal axis in a mesh's material WPO, while still retaining the desired shape when rotated?

Hi Friends!

I’ve found myself a bit stumped with this one, so any input would be much appreciated!

In UE4’s material editor, I have a basic sine pattern that I’m using to deform a sphere along its vertex normals (I’ve included an image of my network below). I would like to mask out the z movement so that the sphere only distorts on the local x and y axis of the mesh, retaining it’s shape, no matter how you rotate it. I’ve tried (afaik) every TransformVector combination that I thought would do the trick, but to no avail. What would a material network look like that solves for this issue?

Best,
Doug.

1 Like

Add a vector of (1.0,1.0,0.0) and transform it from local to world (iirc)
Then multiply the final result by that. Should be fine I think.
What’s the context of a mesh? Is it in a particle system? Depending on where it belongs, there might be a conflict.

1 Like

Hey Doug!

Is this what you’re looking for?

(also a heads up, I’ve moved your topic from General Discussion to our shiny new UE4 subcategory in Technical & Engine Help )

2 Likes

This is exactly what I was looking for! Thank you so very much!

(and thanks for moving this thread into its proper location–I apologize for not doing that initially)

Best,
Dougie.

1 Like

So sifa’s method is absolutely perfect for static meshes (thank you, once again), but for mesh particles, it seems to be a bit trickier. I have a network that solves for that (posted below), but I’m curious if anyone has any other ideas as well–I’d be super interested in hearing them!

Here’s the solve network for mesh particles (hoping it helps someone who runs into the same issue):

2 Likes

Maybe your problem comes bc you are using “Object Position” which outputs the center of the object bounds. You can use Particle Position to get the position of each particle.
Can you show what you got with your current shader on particle meshes?

Hi VMonty,

The above graph does work with mesh particles. I was just sharing this network so that others who are looking for the same info will have a solution. I’m more interested in if there are other (simpler) ways, ideally piggy-backing off of the graph that sifa had constructed.

Best,
Doug.