Prevent raytracing render engine option from crashing the 3D viewer

Fix for lp bug #1667722 using a change made by Mario Luzeiro.

Fixes lp:1667722

https://bugs.launchpad.net/kicad/+bug/1667722
This commit is contained in:
Kevin Cozens 2017-03-01 17:32:15 -05:00 committed by Wayne Stambaugh
parent 9f1e154753
commit 458b0e75e0
1 changed files with 2 additions and 2 deletions

View File

@ -1861,8 +1861,8 @@ SFVEC3F C3D_RENDER_RAYTRACING::shadeHit( const SFVEC3F &aBgColor,
// Improvement: this is not taking in account the lightcolor
if( nr_lights_that_can_cast_shadows > 0 )
{
aHitInfo.m_ShadowFactor = shadow_att_factor_sum /
(float)(nr_lights_that_can_cast_shadows * 1.0f);
aHitInfo.m_ShadowFactor = glm::max( shadow_att_factor_sum /
(float)(nr_lights_that_can_cast_shadows * 1.0f), 0.0f );
}
else
{