Add lightPenetrationRatio option

This commit is contained in:
schmelczerandras 2020-10-19 11:43:40 +02:00
parent ea8aacbb85
commit 044f84c769
4 changed files with 11 additions and 2 deletions

View file

@ -9,5 +9,6 @@ export const defaultStartupSettings: StartupSettings = {
paletteSize: 256, paletteSize: 256,
ignoreWebGL2: false, ignoreWebGL2: false,
backgroundColor: vec4.fromValues(1, 1, 1, 1), backgroundColor: vec4.fromValues(1, 1, 1, 1),
lightPenetrationRatio: 0.75,
enableStopwatch: false, enableStopwatch: false,
}; };

View file

@ -24,6 +24,14 @@ export interface StartupSettings {
*/ */
shadowTraceCount: number; shadowTraceCount: number;
/**
* The illumination is multiplied by this constant where
* the distance field is negative (i.e. inside objects).
*
* Should be between 0 and 1, but other values are also permitted.
*/
lightPenetrationRatio: number;
/** /**
* Gives the number of possible object colors for the scene. * Gives the number of possible object colors for the scene.
* *

View file

@ -2,7 +2,7 @@
precision lowp float; precision lowp float;
#define INTENSITY_INSIDE_RATIO 0.5 #define INTENSITY_INSIDE_RATIO {intensityInsideRatio}
#define SHADOW_TRACE_COUNT {shadowTraceCount} #define SHADOW_TRACE_COUNT {shadowTraceCount}
{macroDefinitions} {macroDefinitions}

View file

@ -2,7 +2,7 @@
precision lowp float; precision lowp float;
#define INTENSITY_INSIDE_RATIO 0.5 #define INTENSITY_INSIDE_RATIO {intensityInsideRatio}
#define SHADOW_TRACE_COUNT {shadowTraceCount} #define SHADOW_TRACE_COUNT {shadowTraceCount}
{macroDefinitions} {macroDefinitions}