1
\$\begingroup\$

Let's look at this picture:

enter image description here

You can see the red rectangles, those are shaded by normalmap.

Here, is the same model with different light angle, there's no normal shading in dark area.

enter image description here

It only happens in Mobile Shader(simplified blinnphong actually). I'm targeting on Android devices, and using Mobile Shader with Normalmap. How do I fix this?

\$\endgroup\$
1
\$\begingroup\$

Since normals encode the facing direction of your surface, they only produce a change in lighting for directional lighting terms:

  • Direct illumination from a directional, point, spot, or area light

  • Indirect illumination or reflection from a light/reflection probe, directional lightmap, or skybox sample

  • Fresnel edge reflection when the view direction just glances along the surface

In shadow, you're not getting any direct lighting so that's out. The standard shader includes a directional ambient term but the mobile shader appears to use a constant ambient light instead, and does not include Fresnel effects.

So, your options are:

  • Use (or make) a shader that uses a directional ambient/global illumination term for some directional variation, or

  • Add a secondary directional light to your scene, pointing at a different angle, to model the directional component of the ambient sky / bounce lighting. This light can be faint so it doesn't overly bias the appearance in lit areas, and non-shadow-casting so it's cheaper and reaches into every enclosed space.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.