Skip to content

Commit

Permalink
Add new light adjustment mode, "Crush"
Browse files Browse the repository at this point in the history
  • Loading branch information
caligari87 committed Mar 31, 2019
1 parent 755eb48 commit 3460faa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion menudef.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ OptionValue "Nice_Modes" {
1, "Subtract"
2, "Compress"
3, "Clamp"
4, "Crush"
10, "DarkDoom Lite"
11, "DarkDoom Classic"
12, "DarkDoom Black"
}

OptionValue "Nice_Settings" {
//0, "Disable"
0, "Disable"
1, "Dim"
2, "Murky"
3, "Dismal"
Expand Down
6 changes: 4 additions & 2 deletions zscript.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class DarkDoomZ_SectorLightAdjust : EventHandler {
if(IsSky) FinalAdjustment *= (0.5 * SkyMode);

// Link to graphing calculator depiction of different modes
// https://www.desmos.com/calculator/iphz6pi8yj
// https://www.desmos.com/calculator/n1lvnyceve
switch(Mode) {
case 1: //subtract raw light level (simple fade)
Level.Sectors[i].Lightlevel = BaseLightLevels[i] - FinalAdjustment;
Expand All @@ -78,7 +78,9 @@ class DarkDoomZ_SectorLightAdjust : EventHandler {
case 3: //clamp max brightness level
Level.Sectors[i].Lightlevel = clamp(BaseLightLevels[i], 0, 256 - FinalAdjustment);
break;
case 4: //
case 4: //apply exponential gamma curve
Level.Sectors[i].Lightlevel = (256 - (FinalAdjustment ** (FinalAdjustment / 256))) * (BaseLightLevels[i] / 256.0) ** (1 + (FinalAdjustment / 32)) ;
break;
case 10: //DarkDoom Lite (fixed subtract mode)
Level.Sectors[i].Lightlevel = BaseLightLevels[i] - 96;
break;
Expand Down

0 comments on commit 3460faa

Please sign in to comment.