Download

Emissive color is applied to shadow areas of normal map

I’ve created a Earth shader which shall show the city lights on the unlit part of the Earth. I’ve masked the textures accordingly. However when using a normal map the emissive color is shown on normal map shadows even when masking.
In order to highlight the issue I’m using a simple red color as emissive for the first two pictures. As you can see the shades generated by the normal map are emissive as well even the mask should hide the color in those areas. It’s a little unclear whether its a bug or a feature.

with normal map


without normal map
with normalmap

This is the expected behaviour as you are using the pixel normal (PixelNormalWS node). To get the effect you intended you should use original vertex normal instead (VertexNormalWS node).

While a little off topic, I would like to ask if you are going for realism? I ask this because it’s a bit of a pet peeve of mine that people always tend to greatly overdo normalmap effects when rendering earth. If you look at actual space photography you’ll notice that at a truly global scale even the Himalayas are very minor bumps on the surface, while in your case the dunes in the Sahara are already shaded as if they are hundreds of kilometers in height.

Works like a charm, thanks for the hint!! Great!

Sure the normalmap is a way to intensive but it’s just a sample project to make the effect more visible. On my original project I tried to get the normals not too bumpy :wink:

see here orbitSIM - An Advanced 3D Visualization Training Tool for Spacecraft Operators - Work in Progress - Unreal Engine Forums