Skip to content

Commit 1968b7d

Browse files
committed
Disable bidirectional brilliance for now, due to it probably becoming obsolete soon anyway.
1 parent e47718e commit 1968b7d

File tree

6 files changed

+26
-8
lines changed

6 files changed

+26
-8
lines changed

changes.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ Materials:
7272
- Colour and pigment maps now support non-linear interpolation to achieve more
7373
pleasing gradients.
7474

75-
- The `brilliance` effect can now be applied not only to incoming light, but
76-
also to outgoing light, making the effect phyiscally more realistic.
77-
7875
- Fresnel angle-dependent attenuation can now also be applied to highlights
7976
and the diffuse component for more physical realism.
8077

source/core/material/texture.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,9 @@ FINISH *Create_Finish()
11581158
New->Diffuse = 0.6;
11591159
New->DiffuseBack = 0.0;
11601160
New->Brilliance = 1.0;
1161+
#if POV_PARSER_EXPERIMENTAL_BRILLIANCE_OUT
11611162
New->BrillianceOut = 1.0;
1163+
#endif
11621164
New->BrillianceAdjust = 1.0;
11631165
New->BrillianceAdjustRad = 1.0;
11641166
New->Phong = 0.0;

source/core/material/texture.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ struct Texture_Struct : public Pattern_Struct
124124

125125
struct Finish_Struct
126126
{
127-
SNGL Diffuse, DiffuseBack, Brilliance, BrillianceOut, BrillianceAdjust, BrillianceAdjustRad;
127+
SNGL Diffuse, DiffuseBack, Brilliance;
128+
#if POV_PARSER_EXPERIMENTAL_BRILLIANCE_OUT
129+
SNGL BrillianceOut;
130+
#endif
131+
SNGL BrillianceAdjust, BrillianceAdjustRad;
128132
SNGL Specular, Roughness;
129133
SNGL Phong, Phong_Size;
130134
SNGL Irid, Irid_Film_Thickness, Irid_Turb;

source/core/render/trace.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,10 @@ void Trace::ComputeLightedTexture(MathColour& resultColour, ColourChannel& resul
936936
radiosityContribution += (layCol.colour() * ambBackCol) * (att * diffuse);
937937
}
938938

939+
#if POV_PARSER_EXPERIMENTAL_BRILLIANCE_OUT
939940
if((sceneData->radiositySettings.brilliance) && (layer->Finish->BrillianceOut != 1.0))
940941
radiosityContribution *= pow(fabs(cos_Angle_Incidence), layer->Finish->BrillianceOut-1.0) * (layer->Finish->BrillianceOut+7.0)/8.0;
942+
#endif
941943

942944
if(layer->Finish->Fresnel)
943945
{
@@ -976,11 +978,13 @@ void Trace::ComputeLightedTexture(MathColour& resultColour, ColourChannel& resul
976978

977979
ComputeDiffuseLight(layer->Finish, isect.IPoint, ray, layNormal, layCol.colour(), classicContribution, att, isect.Object, relativeIor);
978980

981+
#if POV_PARSER_EXPERIMENTAL_BRILLIANCE_OUT
979982
if(layer->Finish->BrillianceOut != 1.0)
980983
{
981984
double cos_angle_of_incidence = dot(ray.Direction, layNormal);
982985
classicContribution *= pow(fabs(cos_angle_of_incidence), layer->Finish->BrillianceOut-1.0)* (layer->Finish->BrillianceOut+7.0)/8.0;
983986
}
987+
#endif
984988

985989
tmpCol += classicContribution;
986990
}
@@ -995,11 +999,13 @@ void Trace::ComputeLightedTexture(MathColour& resultColour, ColourChannel& resul
995999

9961000
ComputePhotonDiffuseLight(layer->Finish, isect.IPoint, ray, layNormal, rawnormal, layCol.colour(), photonsContribution, att, isect.Object, relativeIor, *surfacePhotonGatherer);
9971001

1002+
#if POV_PARSER_EXPERIMENTAL_BRILLIANCE_OUT
9981003
if(layer->Finish->BrillianceOut != 1.0)
9991004
{
10001005
double cos_angle_of_incidence = dot(ray.Direction, layNormal);
10011006
photonsContribution *= pow(fabs(cos_angle_of_incidence), layer->Finish->BrillianceOut-1.0) * (layer->Finish->BrillianceOut+7.0)/8.0;
10021007
}
1008+
#endif
10031009

10041010
tmpCol += photonsContribution;
10051011
}

source/parser/configparser.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
///
5050
/// @{
5151

52-
/// @def POV_PARSER_MAX_CACHED_MACRO_SIZE
53-
/// Default size limit for macros to be cached in memory.
52+
/// @def POV_PARSER_EXPERIMENTAL_BRILLIANCE_OUT
53+
/// Whether experimental second brilliance parameter should be enabled.
5454
///
55-
#ifndef POV_PARSER_MAX_CACHED_MACRO_SIZE
56-
#define POV_PARSER_MAX_CACHED_MACRO_SIZE 65536
55+
#ifndef POV_PARSER_EXPERIMENTAL_BRILLIANCE_OUT
56+
#define POV_PARSER_EXPERIMENTAL_BRILLIANCE_OUT 0
5757
#endif
5858

5959
/// @def POV_PARSER_EXPERIMENTAL_OBJ_IMPORT
@@ -63,6 +63,13 @@
6363
#define POV_PARSER_EXPERIMENTAL_OBJ_IMPORT 0
6464
#endif
6565

66+
/// @def POV_PARSER_MAX_CACHED_MACRO_SIZE
67+
/// Default size limit for macros to be cached in memory.
68+
///
69+
#ifndef POV_PARSER_MAX_CACHED_MACRO_SIZE
70+
#define POV_PARSER_MAX_CACHED_MACRO_SIZE 65536
71+
#endif
72+
6673
//******************************************************************************
6774
///
6875
/// @name Debug Settings.

source/parser/parser_materials.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,8 +2280,10 @@ void Parser::Parse_Finish (FINISH **Finish_Ptr)
22802280

22812281
CASE (BRILLIANCE_TOKEN)
22822282
New->Brilliance = Parse_Float ();
2283+
#if POV_PARSER_EXPERIMENTAL_BRILLIANCE_OUT
22832284
Parse_Comma();
22842285
New->BrillianceOut = Allow_Float(1.0);
2286+
#endif
22852287
END_CASE
22862288

22872289
CASE (DIFFUSE_TOKEN)

0 commit comments

Comments
 (0)