Normal Map and Green Channel

Hi.

Can somebody clarify this. Im starting to be little bit paranoid.

I took a ball in ZB and rendered it with NormalRGBMat.

ZB_NormalMat.png

Then i noticed that the ball is somehow inverted/flipped in UE4.

Peview.png

In Gimp a flipped Green Channel because somebody said it could be Green Channel.

Im not sure is the result correct.

I think you might need to switch the red and green channels

Now it looks like this:

FlpGR1.png

Material has only Normal Map, with gray colour and no Metallic, Specular or Roughness.

So i found this:

Difference is:

Original:
Exmpl1.png

And Fixed:
Exmpl2Toms.png

Results:

Im still not sure is this fixed shader proper one.

I hate this. Nowadays u cant get right results from what is offered in standalone package.

That original matcap you posted doesn’t look like any proper normal map I’ve seen. I think zbrush is to blame here, but it seems like you know that. You could try using Xnormal, which is free.

If its a sphere pointing outwards, the green channel should be bright on the bottom, not the top. if its looking correct in ue4, maybe you have Flip Green channel checked in the texture properties. So your 2nd attempt looks the most correct to me in terms of normal map orientation (ignoring the weird dark edge outline and facets).

Are you using UV channel0? tangent basis is only computed for UV0 so if you use anything else for normals it can give wrong results. Do you maybe have “tangent space normal = false” in your material?

When in doubt, go to engine\content, filter by texture and type “Sphere”. There is a normal map of a sphere in there that is known to be correct. Slap it on a new material under normal just to be safe.

Ok, so here is the UE4 Sphere Normal Map:

EngineContent.png

It acts this way:

EngineContent.pngResultMidd.pngResultRight.png

In Material settings it looks weird:

3d object is just Box Brush:

ResultLeft.png

"If its a sphere pointing outwards, the green channel should be bright on the bottom, not the top. if its looking correct in ue4, maybe you have Flip Green channel checked in the texture properties. So your 2nd attempt looks the most correct to me in terms of normal map orientation (ignoring the weird dark edge outline and facets).

Are you using UV channel0? tangent basis is only computed for UV0 so if you use anything else for normals it can give wrong results. Do you maybe have “tangent space normal = false” in your material?"

How do i flip channels in UE4 editor? And where is UV Channel0 and Tangent Space Normal settings?

The lighting from the light looks correct. The only part that looks weird is the purple under lighting. Where is that coming from?

UV channel 0 is defined on your mesh itself in max or wherever you import from. Tangent space normal is a material setting on each material. But it looks like you have it correct.

Flip Green Channel is a texture property. Just open texture and type flip in the search.

You can also multiply by a vectorpameters (or constant3vector) like 1,-1,1 to flip green channel dynamically, or -1,1,1 to flip red channel etc. That way you can toggle it and see the results.

Could it be that the Normal Map Sphere is so bumpy/hilly and light source is so narrow that it never reaches the outer edge of the sphere?


I found also this, which looks pretty close what UE4 sample offers:

UE4 Sample:

Red Tangent MatCap:
RedTangentZB.png

So only thing is to flip that Red Tangent vertically in ZB, because i cant import this UE4 Sphere Normal correctly to ZB. It is important to get this work in ZB, because it is easy to work with tiling textures in there, without making any baking.

Not sure what you are asking since I do not see a problem in the image. At the edge of the sphere, the normal is 90 degrees from the front surface. A light shining to the front of the sphere would be expected to have 0 brightness received from at the side from the light since light does not get received at a 90 degree angle, it passes by. It has nothing to do with the light being narrow. It will be the same with a pointlight.

Ah, sorry. U asked about that purple thing generally. I think it is shadow colour which was set somewhere.

Now there is problem with compression things. If the texture Compression Setting is set default, it cannot be used as Normal Map, but if it is set to Normal Map Compression, it creates …


Compression.png

The settings with “normal map compression” look correct to me. The light response from that point light looks right compared to the normal map.
(The normal map isn’t “physical” in the sense that it doesn’t move the geometry, so it will look squished when you take it to extremes like you do.)

In general, the red channel of a normal map means “normal direction along the U texture coordinate.”
The green channel of a normal map means “normal direction along the V texture coordinate.”
And, the blue channel means “normal direction straight out from the surface.”
Because normals can be both positive and negative, normal maps are typically biased so that 0.5 color value means 0.0 direction, and 0.0 color means -1.0 direction, and 1.0 color means +1.0 direction, for the red and green channels.
Because the blue channel will never point “in” towards the surface, AND because normals are normalized to length 1, Normal Map Compression takes advantage of this and entirely drops the blue channel, just storing the read (U) and green (V) channels, and then re-creating a normalized normal with blue (W) component after sampling.
This is why “normal map compression” is needed for normal map textures, typically.

Yea, looks like your input texture is not normalized to start with. You can try normalizing it in photoshop by getting the nvidia photoshop plugin and running it in ‘normalize only’ mode if you wish the sanity check.

Re: purple light, looks expected if you have that set. its making the skylight emit purple from the bottom half, but since your sky is black, its capturing black for the top.

U guys been awesome. Never experienced such good support.

Here is the final procedure:

  1. Download: Free Enhanced NormalRGBMat
    This ZB Material has the best colour profile for rendering Normal Maps in the real-time renderer, and it gives very lush bumps.

  2. (I dont know how to thx everybody.) Here is a little tutorial how to flip the green channel in ZB.

-Setup 3d scene for testing.

-Load the downloaded Mat (Free Enhanced NormalRGBMat).

-Create new document to clear the canvas and set the size to for example 1024x1024.

-Load current Texture as Image Plane. This is the only way to make MatCap texture ready for editing.

-Capture the canvas to Texture.

-Flip the Texture Sample vertically.

-Set the new flipped texture to Material as a new colour profile.

-Now u should have full functioning Material for rendering anything in ZB out to UE4.

-Turn off the shadows.

-Export the Canvas as a texture.

  1. Take the texture to NVIDIA plugin and normalize it:
    Normalize.png

  2. Should look pretty good in UE4 with compression. In this case there is some little artifacts there, but it could be because of ZB rendering and not enough polygons in the sphere.

  3. And here is how it looks in the action: