Lighting issues
#2
When using up to 3 directional lights (+ optional ambient light) then an optimized version of shader is used. When using more than 3 directional lights or a point light or a spotlight, then a more complex shader is used.

The optimized version of the shader also does not support normal and specular maps.

When trying to reproduce your issue I was not able to get the strange results that you had. But I have found out that in the case when 3 or fewer directional lights are used, the DXEngin does not use the complex version of the shader and therefore renders the objects with only diffuse texture (without normal and specular map).

I have fixed this issue so in the next version this should work correctly. If you want I can send you a pre-release version with this fix.

As you have found out, the workaround for the current version is to add a point light with almost black color (black disables the light) and with Range set to 0 (to quickly discard using the color). For example:
<PointLight Position="0 0 0" Color="#010101" Range="0" />

You can also add additional directional lights with almost black color so that you will have 4 directional lights.

This will require that the shader will need to process additional lights but in almost all cases this should not be noticeable and hardly measurable.
Andrej Benedik
  


Messages In This Thread
Lighting issues - by janovrom - 09-29-2021, 05:36 PM
RE: Lighting issues - by abenedik - 09-30-2021, 12:32 PM
RE: Lighting issues - by janovrom - 09-30-2021, 02:11 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)