World Aligned Normal Problem


Here I’m using a normal map with “Normal” compression. The result on sphere looks fine.

But when I use a channel packed normal map with “Masks” compression the result looks wrong.

When I apply it to landscape it works fine, but on meshes, it looks terrible just like on the Sphere.

I couldn’t find the cause :confused:
Any help will be appreciated.

I am curious, Whats the size of your texture and why is the TextureSize on the world aligned normal just 500 and not 512?

Also it doesnt seem fine to me in that image.

World aligned Normal material function by default rotates your normal to match vertex normals for each projection, and thus depends on blue channel already unpacked.
You should modify material function to unpack your normals inside the function, instead of trying to unpack result of the blend.

@DieByZer0, “Texture size” is how big the texture looks on the surface.

But I’m doing Z projection only. I went ahead and added that B channel reconstruction inside the function right after texture input, but still getting weird result. Or am I doing it wrong? :confused:

I’m willing to bet that you did it in WorldAlignedNormal, while should have changed subfunction WorldAlignedNormals_HighQuality.

Oh… um… okay. Where should I add it? :eek:


Thanks man! :slight_smile:
The projection is fine now, though the problem is the normal map is inverted on the bottom half creating a seam in the middle. :confused:

Edit: The bottom half doesn’t really matter to me, thanks for the help @Deathrey! :slight_smile:

Try replacing the chain you use to unpack normal map with the custom node, set to output float3, with one input called input and the following code:

return UnpackNormalMap(float4(input.rg,0,0)).rgb;

Normal map red and green should be in red and green channel of input obviously.
Check if it fixes the issue.

Like this? I’m surely doing it wrong because it didn’t fix the bottom half of the sphere.

Another issue is that when the mesh is rotated the normal colors are rotating with it all the way. :frowning:

Edit: So even with original WorldAlignedNormal and unpacked normal map still the colors shift as mesh rotates…

Here’s a clean test.
Original WorldAlignedNormal node + Normal map with “Normal compression”.
Tangent Space Normals is unchecked in material.
Sphere rotated 90 Degrees, normal pattern is fixed but the colors shift.

Anyone know what should I do?

Edit: Same problem happens with WorldAlignedTextures_Complex too.