Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/engine/renderer/glsl_source/lightMapping_fp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ void main()
// Compute light direction in world space from deluxe map.
vec4 deluxe = texture2D(u_DeluxeMap, var_TexLight);
vec3 lightDir = normalize(2.0 * deluxe.xyz - 1.0);

/* HACK: blend a bit the normal map with the deluxe map to make the normal
map align with the deluxe map to prevent NdotL collapsing to zero, while
retaining enough normal details.
See: https://github.com/DaemonEngine/Daemon/issues/1905 */
float normalBlendFactor = 0.5;
normal = normalize(normal * normalBlendFactor + lightDir * (1.0 - normalBlendFactor));
#elif defined(USE_GRID_DELUXE_MAPPING)
// Compute light direction in world space from light grid.
vec4 texel = texture3D(u_LightGrid2, lightGridPos);
Expand Down
Loading