Download

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.

Ball.png 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.

FlipInGimp.png

InvertinG.png

Inverted.png

Im not sure is the result correct.

PeviewF.png

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

Now it looks like this:

FlpGR1.png FlpGR2.png FlpGR3.png

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

So i found this:

Difference is:

Original:
27f4a3c65d1a42977ace8d173ba22b12ae18ac87.png

And Fixed:
cd55b7a0e56dae983a3eb9a3d90608b013a50290.png

Results:
b9610b6c4ad97bae829f96170fe83ceef9bdfbcc.pngRsltMidd.pngRsltRight.png

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:

9d61335b605aa6f5436c0ae146f692cc8e26be60.pngResultMidd.pngResultRight.png

In Material settings it looks weird:

SpehereUE4MaterilaSett.png

3d object is just Box Brush:

427963d66c83655bad801cc7e5671ff041a3fef4.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?

ExtremeBumpy.png
ExtremeBumpy2.png

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

http://www.zbrushcentral.com/showthread.php?198675-Free-Enhanced-NormalRGBMat&highlight=normalrgbmat

UE4 Sample:
SphereRenderNormalsMapUE4.png

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.

Hemi.png

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 …

CompressionEnab.jpg
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: http://www.zbrushcentral.com/showthread.php?198675-Free-Enhanced-NormalRGBMat&highlight=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.
SetupScene.png

-Load the downloaded Mat (http://www.zbrushcentral.com/showthread.php?198675-Free-Enhanced-NormalRGBMat&highlight=normalrgbmat).
adadaa4b66edd1698f7e4e4038ef15f057d9aa75.png

  • Create MatCapTexture.
    43129f1dd592a68ff06f101064e61c0ddb8e2de4.png

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

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

-Capture the canvas to Texture.
GrabDoc.png

-Flip the Texture Sample vertically.
ffad245b705cfdead5cfd3d535ab7f04f63d83eb.png

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

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

-Turn off the shadows.
51cb028e86848e5260ba4673f6cfeb0c0afd582b.jpeg

-Export the Canvas as a texture.
03453f20db017e275886e7ad15187075671c743a.png

  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.
    de21a1af999afe28687c25036c83f07afce5df02.jpeg

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