normalize rendered light color for display consistency (compiler normalizes it anyway)

lower 3d light sphere brightness to reduce occlusion
#63
This commit is contained in:
Garux
2022-12-17 02:15:38 +06:00
parent d41adc5e93
commit 88a03b07be
5 changed files with 35 additions and 17 deletions

View File

@@ -509,13 +509,11 @@ void Entity_ungroupSelectedPrimitives(){
/* scale color so that at least one component is at 1.0F */
void NormalizeColor( Vector3& color ){
const std::size_t maxi = vector3_max_abs_component_index( color );
if ( color[maxi] == 0.f )
const auto max = vector3_max_component( color );
if ( max == 0 )
color = Vector3( 1, 1, 1 );
else{
const float max = color[maxi];
else
color /= max;
}
}
void Entity_normalizeColor(){