UE4 - Is it possible to scale vertex normals to zero?

Hello there !

Here’s a little problem that I’ve been scratching my head for a couple of hour now.

I want to shrink this model into “wire thin”:

-either by clamping the normals to avoid them to flip inside out
-or scale the normals non-uninformingly (depending on the mesh thicness then)

problem

Does someone got an idea on where to begin ?

1 Like

Short answer:
This can’t be done generically just in the material. You cannot know per vertex the center along the bones. So you can’t know the amount you would have to move per vertex. You will need to precompute some information.

Long answer:
If the material graph exposed the skin weights, you could probably do it, but it doesn’t so you have to go through precomputation. There are lots of ways to do this, I’m not sure what the best method would be, but what I would do for a character is: use houdini and create a tube version of the character that is skinned to the same bones. I would raycast each vertex against that tube version and move the vertices so they wrap around the tube. I would get the delta, the difference in position between the source and the tube version and store that as a float in an extra UV channel of the skeletal mesh.

I would then use that value, multiplied by the normals, to reconstruct the tube version in unreal.

An alternative would be to use distance fields, but again with skinned meshes especially I would precompute the distance I want the vertices to move in a rest pose so that I can recreate it in unreal at runtime.

Hopefully this gives you an inkling of what you need to do.

You can do this in unreal entirely, but you will be storing the offset in a texture instead of uvs, and if you aren’t familiar with using rendertextures in blueprints I’d recommend against it.

Perhaps someone has a cleverer idea, but my money is on you needing to precompute.

1 Like

Thanks for your answer.

Well it’s indeed more complex than I imagined.
Now I’m just assessing if It’s worth doing considering they are other effects on top of it .

But in any case thanks for the hint and I’ll post the result as soon as it’s done. :ok_hand:

1 Like