Object Space NormalMap

Hi there,

I was wondering if anyone got a material setup for using object-space normal maps?
My meshes are not deformed (just moved/rotated/scaled) and I want my normal maps to be in object space and I unchecked the “Tangent space normals” in the material so that it uses world-space normals.
However the lighting rotates with the the object now, which means the normals need to be transformed from object space to world space somehow. I can’t seem to figure out how to do this.

In the material I tried the “Transform Vector” node(local to world) to transform the normals given by the object space normal map(making sure the normals
are in -1|+1 range) into worldspace but it doesnt work .

Maybe any of you guys have a clue how to do this correctly or even a working material that uses object-space-normal maps?

Thank you very much
Syphorlate

Is there a particular reason you want to use object space normal maps?

I am not sure, but I remember having issues with retrieving local transform with Transform Vector node. Perhaps, you could try using Transform Position node instead.

Hey , can someone tell me / us what

means ? I am researching on that topic too, but there is not much to find on that kind of topic. I would greatfully appreciate if you share some insights on that :slight_smile:

Show material graph and how it does not work when you transform normal map from object space to world space.

Okay, I got it to work.

I baked an object space normal in Blender, and imported it into UE4

The compression method in UE4 is set to Vector Displacementmap, not Normalmap, sRGB off.

This is the material graph, I re-range the normalmap from 0-1 to -0.5,0.5 and invert the blue channel. Then I transform the vector to Worldspace.

Seems to work!

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“large”,“data-tempid”:“temp_129326_1518521736822_297”}[/ATTACH]

NormalMap compression does not work for other than tangent space normals because it’s assumes that z is always positive and reconstruct it from x and y. You still need to multiply normal with 2 to get unit length normal. This isn’t strictly needed because engine will normalize the normal for you.

Hi, 1 year later, I use this forum to document my discovery and to help me in the future so I archive my material here.

I use Power(X, 0.4574), then no need to uncheck the sRGB all the time, otherwise you may get confused when there are many textures and you forget one of them.
I transform the normals with the invert of the scale: Multiply(N, Divide(1, Scale_XYZ)).

Here is the result:
Mesh.jpg

2 Likes

What compression would you use in UE4 for object-space normal maps?

When saving an Object Space NormalMap texture from Blender for example then the compression is not NormalMap, but it’s the default compression.