Skip to content

Commit 7ee8d46

Browse files
committed
Merge branch 'bugfix/colour_model_shadows' into official/feature/colour_model
2 parents 6c221ad + c5afcec commit 7ee8d46

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

source/backend/render/trace.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,11 +1600,11 @@ void Trace::ComputeOneDiffuseLight(LightColour& colour, const LightSource &light
16001600
}
16011601

16021602
ComputeClassicColour(colour, lightColour, layer_pigment_colour, eye.Direction, lightsourceray.Direction, layer_normal, finish, ipoint, relativeIor, attenuation, backside,
1603-
// NK rad - don't compute highlights for radiosity gather rays, since this causes
1604-
// problems with colors being far too bright
1605-
// TODO FIXME radiosity - is this really the right way to do it (speaking of realism)?
1606-
// don't compute highlights for diffuse backside illumination
1607-
(lightsource.Light_Type != FILL_LIGHT_SOURCE) && !eye.IsRadiosityRay() && !backside);
1603+
// NK rad - don't compute highlights for radiosity gather rays, since this causes
1604+
// problems with colors being far too bright
1605+
// TODO FIXME radiosity - is this really the right way to do it (speaking of realism)?
1606+
// don't compute highlights for diffuse backside illumination
1607+
(lightsource.Light_Type != FILL_LIGHT_SOURCE) && !eye.IsRadiosityRay() && !backside);
16081608
}
16091609
}
16101610

@@ -1659,7 +1659,6 @@ void Trace::ComputeFullAreaDiffuseLight(LightColour& colour, const LightColour&
16591659
double jitter_u = (double)u;
16601660
double jitter_v = (double)v;
16611661
bool backside = false;
1662-
LightColour tmpCol;
16631662

16641663
if(lightsource.Jitter)
16651664
{
@@ -1722,11 +1721,11 @@ void Trace::ComputeFullAreaDiffuseLight(LightColour& colour, const LightColour&
17221721
}
17231722

17241723
ComputeClassicColour(colour, attenuatedLightcolour, layer_pigment_colour, eye.Direction, lsr.Direction, layer_normal, finish, ipoint, relativeIor, attenuation, backside,
1725-
// NK rad - don't compute highlights for radiosity gather rays, since this causes
1726-
// problems with colors being far too bright
1727-
// TODO FIXME radiosity - is this really the right way to do it (speaking of realism)?
1728-
// don't compute highlights for diffuse backside illumination
1729-
(lightsource.Light_Type != FILL_LIGHT_SOURCE) && !eye.IsRadiosityRay() && !backside);
1724+
// NK rad - don't compute highlights for radiosity gather rays, since this causes
1725+
// problems with colors being far too bright
1726+
// TODO FIXME radiosity - is this really the right way to do it (speaking of realism)?
1727+
// don't compute highlights for diffuse backside illumination
1728+
(lightsource.Light_Type != FILL_LIGHT_SOURCE) && !eye.IsRadiosityRay() && !backside);
17301729
}
17311730
}
17321731
}
@@ -2276,7 +2275,7 @@ void Trace::ComputeShadowColour(LightColour& colour, const LightSource &lightsou
22762275
if(fabs(resultColour.Weight()) < lightsourceray.GetTicket().adcBailout)
22772276
{
22782277
// close enough to full shadow - bail out to avoid media computations
2279-
resultColour.Clear();
2278+
colour.Clear();
22802279
return;
22812280
}
22822281

@@ -2355,7 +2354,7 @@ void Trace::ComputeDiffuseColour(LightColour& colour, const LightColour& lightCo
23552354
colour += intensity * pigmentColour * lightColour * cs1 * cs2;
23562355
}
23572356
else
2358-
colour += intensity * pigmentColour * lightColour;
2357+
colour += intensity * pigmentColour * lightColour;
23592358
}
23602359

23612360
void Trace::ComputePhongColour(LightColour& colour, const LightColour& lightColour, const AttenuatingColour& pigmentColour,
@@ -2364,7 +2363,6 @@ void Trace::ComputePhongColour(LightColour& colour, const LightColour& lightColo
23642363
{
23652364
double cos_angle_of_incidence, deviation, intensity;
23662365
Vector3d reflectToLight;
2367-
AttenuatingColour cs;
23682366

23692367
cos_angle_of_incidence = -dot(normal, fromEye);
23702368

@@ -2374,7 +2372,7 @@ void Trace::ComputePhongColour(LightColour& colour, const LightColour& lightColo
23742372

23752373
if(deviation > 0.0)
23762374
{
2377-
if((finish->Phong_Size < 60) || (cos_angle_of_incidence > 0.0008)) // rgs
2375+
if((finish->Phong_Size < 60) || (deviation > 0.0008)) // rgs
23782376
{
23792377
intensity = finish->Phong * pow(deviation, (double)finish->Phong_Size);
23802378

0 commit comments

Comments
 (0)