Skip to content

Commit

Permalink
Fix specular visible in shadow [bce08a4 backport]
Browse files Browse the repository at this point in the history
  • Loading branch information
Delt06 committed May 25, 2022
1 parent ccea415 commit 650aa14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ half4 frag(const v2f input) : SV_Target
half3 specular_color = 0;
#ifdef _SPECULAR
specular_color = get_specular_color(main_light.color, view_direction_ws, normal_ws, tangent_ws, light_direction_ws);
specular_color *= main_light_attenuation;
#endif

#if defined(TOON_ADDITIONAL_LIGHTS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,11 @@ inline void additional_lights(const half4 position_cs, const float3 position_ws,
#else
ramp_color *= brightness;
#endif
const half attenuation_step = step(0.001, attenuation);
diffuse_color += ramp_color * attenuation_step;
diffuse_color += ramp_color;

#ifdef TOON_ADDITIONAL_LIGHTS_SPECULAR
specular_color += get_specular_color(light.color, view_direction_ws, normal_ws, tangent_ws, light.direction) *
attenuation_step;
attenuation;
#endif
}
}
Expand Down

0 comments on commit 650aa14

Please sign in to comment.