mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-21 15:29:30 -07:00
Replacing "logarithmic brightness" with a simple brightness-and-contrast setup. Adjusting a bunch of configs.
This commit is contained in:
48
js/config.js
48
js/config.js
@@ -59,18 +59,20 @@ const defaults = {
|
|||||||
resurrectingCodeRatio: 0, // The percent of columns that flow upward
|
resurrectingCodeRatio: 0, // The percent of columns that flow upward
|
||||||
animationSpeed: 1, // The global rate that all animations progress
|
animationSpeed: 1, // The global rate that all animations progress
|
||||||
forwardSpeed: 0.25, // The speed volumetric rain approaches the eye
|
forwardSpeed: 0.25, // The speed volumetric rain approaches the eye
|
||||||
bloomStrength: 1, // The intensity of the bloom
|
bloomStrength: 0.7, // The intensity of the bloom
|
||||||
bloomSize: 0.6, // The amount the bloom calculation is scaled
|
bloomSize: 0.4, // The amount the bloom calculation is scaled
|
||||||
highPassThreshold: 0.1, // The minimum brightness that is still blurred
|
highPassThreshold: 0.1, // The minimum brightness that is still blurred
|
||||||
cycleSpeed: 1, // The speed glyphs change
|
cycleSpeed: 0.5, // The speed glyphs change
|
||||||
cycleFrameSkip: 1, // The global minimum number of frames between glyphs cycling
|
cycleFrameSkip: 1, // The global minimum number of frames between glyphs cycling
|
||||||
cycleStyleName: "cycleFasterWhenDimmed", // The way glyphs cycle, either proportional to their brightness or randomly
|
cycleStyleName: "cycleFasterWhenDimmed", // The way glyphs cycle, either proportional to their brightness or randomly
|
||||||
cursorEffectThreshold: 1, // The minimum brightness for a glyph to still be lit up as a cursor at the bottom of a raindrop
|
cursorEffectThreshold: 1, // The minimum brightness for a glyph to still be lit up as a cursor at the bottom of a raindrop
|
||||||
|
baseBrightness: -0.5, // The brightness of the glyphs, before any effects are applied
|
||||||
|
baseContrast: 1.25, // The contrast of the glyphs, before any effects are applied
|
||||||
brightnessOverride: 0.0, // A global override to the brightness of displayed glyphs. Only used if it is > 0.
|
brightnessOverride: 0.0, // A global override to the brightness of displayed glyphs. Only used if it is > 0.
|
||||||
brightnessThreshold: 0, // The minimum brightness for a glyph to still be considered visible
|
brightnessThreshold: 0, // The minimum brightness for a glyph to still be considered visible
|
||||||
brightnessDecay: 1.0, // The rate at which glyphs light up and dim
|
brightnessDecay: 1.0, // The rate at which glyphs light up and dim
|
||||||
ditherMagnitude: 0.05, // The magnitude of the random per-pixel dimming
|
ditherMagnitude: 0.05, // The magnitude of the random per-pixel dimming
|
||||||
fallSpeed: 0.75, // The speed the raindrops progress downwards
|
fallSpeed: 0.3, // The speed the raindrops progress downwards
|
||||||
glyphEdgeCrop: 0.0, // The border around a glyph in a font texture that should be cropped out
|
glyphEdgeCrop: 0.0, // The border around a glyph in a font texture that should be cropped out
|
||||||
glyphHeightToWidth: 1, // The aspect ratio of glyphs
|
glyphHeightToWidth: 1, // The aspect ratio of glyphs
|
||||||
glyphVerticalSpacing: 1, // The ratio of the vertical distance between glyphs to their height
|
glyphVerticalSpacing: 1, // The ratio of the vertical distance between glyphs to their height
|
||||||
@@ -90,7 +92,7 @@ const defaults = {
|
|||||||
{ hsl: [0.3, 0.9, 0.7], at: 0.7 },
|
{ hsl: [0.3, 0.9, 0.7], at: 0.7 },
|
||||||
{ hsl: [0.3, 0.9, 0.8], at: 0.8 },
|
{ hsl: [0.3, 0.9, 0.8], at: 0.8 },
|
||||||
],
|
],
|
||||||
raindropLength: 1, // Adjusts the frequency of raindrops (and their length) in a column
|
raindropLength: 0.75, // Adjusts the frequency of raindrops (and their length) in a column
|
||||||
slant: 0, // The angle at which rain falls; the orientation of the glyph grid
|
slant: 0, // The angle at which rain falls; the orientation of the glyph grid
|
||||||
resolution: 0.75, // An overall scale multiplier
|
resolution: 0.75, // An overall scale multiplier
|
||||||
useHalfFloat: false,
|
useHalfFloat: false,
|
||||||
@@ -107,15 +109,16 @@ const versions = {
|
|||||||
width: 40,
|
width: 40,
|
||||||
},
|
},
|
||||||
operator: {
|
operator: {
|
||||||
|
bloomSize: 0.6,
|
||||||
bloomStrength: 0.75,
|
bloomStrength: 0.75,
|
||||||
highPassThreshold: 0.0,
|
highPassThreshold: 0.0,
|
||||||
cycleSpeed: 0.2,
|
cycleSpeed: 0.2,
|
||||||
cycleFrameSkip: 8,
|
cycleFrameSkip: 8,
|
||||||
cycleStyleName: "cycleRandomly",
|
cycleStyleName: "cycleRandomly",
|
||||||
cursorEffectThreshold: 0.64,
|
cursorEffectThreshold: 0.725,
|
||||||
brightnessOverride: 0.22,
|
brightnessOverride: 0.22,
|
||||||
brightnessThreshold: -1.0,
|
brightnessThreshold: 0,
|
||||||
fallSpeed: 0.65,
|
fallSpeed: 0.6,
|
||||||
glyphEdgeCrop: 0.15,
|
glyphEdgeCrop: 0.15,
|
||||||
glyphHeightToWidth: 1.35,
|
glyphHeightToWidth: 1.35,
|
||||||
rippleTypeName: "box",
|
rippleTypeName: "box",
|
||||||
@@ -130,10 +133,12 @@ const versions = {
|
|||||||
nightmare: {
|
nightmare: {
|
||||||
font: "gothic",
|
font: "gothic",
|
||||||
highPassThreshold: 0.7,
|
highPassThreshold: 0.7,
|
||||||
|
baseBrightness: -0.9,
|
||||||
brightnessDecay: 0.75,
|
brightnessDecay: 0.75,
|
||||||
fallSpeed: 1.2,
|
fallSpeed: 1.2,
|
||||||
hasThunder: true,
|
hasThunder: true,
|
||||||
numColumns: 60,
|
numColumns: 60,
|
||||||
|
cycleSpeed: 1,
|
||||||
paletteEntries: [
|
paletteEntries: [
|
||||||
{ hsl: [0.0, 1.0, 0.0], at: 0.0 },
|
{ hsl: [0.0, 1.0, 0.0], at: 0.0 },
|
||||||
{ hsl: [0.0, 1.0, 0.2], at: 0.2 },
|
{ hsl: [0.0, 1.0, 0.2], at: 0.2 },
|
||||||
@@ -149,13 +154,14 @@ const versions = {
|
|||||||
bloomStrength: 1,
|
bloomStrength: 1,
|
||||||
highPassThreshold: 0,
|
highPassThreshold: 0,
|
||||||
cycleSpeed: 0.1,
|
cycleSpeed: 0.1,
|
||||||
|
baseBrightness: -0.1,
|
||||||
brightnessDecay: 0.05,
|
brightnessDecay: 0.05,
|
||||||
fallSpeed: 0.02,
|
fallSpeed: 0.04,
|
||||||
hasSun: true,
|
hasSun: true,
|
||||||
isPolar: true,
|
isPolar: true,
|
||||||
rippleTypeName: "circle",
|
rippleTypeName: "circle",
|
||||||
rippleSpeed: 0.1,
|
rippleSpeed: 0.1,
|
||||||
numColumns: 30,
|
numColumns: 40,
|
||||||
paletteEntries: [
|
paletteEntries: [
|
||||||
{ hsl: [0.0, 0.0, 0.0], at: 0.0 },
|
{ hsl: [0.0, 0.0, 0.0], at: 0.0 },
|
||||||
{ hsl: [0.0, 0.8, 0.3], at: 0.3 },
|
{ hsl: [0.0, 0.8, 0.3], at: 0.3 },
|
||||||
@@ -175,15 +181,15 @@ const versions = {
|
|||||||
},
|
},
|
||||||
updated: {
|
updated: {
|
||||||
font: "resurrections",
|
font: "resurrections",
|
||||||
numColumns: 100,
|
bloomStrength:1,
|
||||||
fallSpeed: 0.35,
|
bloomSize:0.6,
|
||||||
cycleStyle: "cycleRandomly",
|
numColumns: 70,
|
||||||
cycleSpeed: 0.8,
|
cycleStyleName: "cycleRandomly",
|
||||||
glyphEdgeCrop: 0.1,
|
cycleSpeed: 0.15,
|
||||||
paletteEntries: [
|
paletteEntries: [
|
||||||
{ hsl: [0.39, 0.9, 0.0], at: 0.0 },
|
{ hsl: [0.38, 0.9, 0.0], at: 0.0 },
|
||||||
{ hsl: [0.39, 1.0, 0.6], at: 0.5 },
|
{ hsl: [0.38, 1.0, 0.6], at: 0.92 },
|
||||||
{ hsl: [0.39, 1.0, 1.0], at: 1.0 },
|
{ hsl: [0.38, 1.0, 1.0], at: 1.0 },
|
||||||
],
|
],
|
||||||
raindropLength: 1.4,
|
raindropLength: 1.4,
|
||||||
highPassThreshold: 0.2,
|
highPassThreshold: 0.2,
|
||||||
@@ -196,7 +202,7 @@ const versions = {
|
|||||||
raindropLength: 1.2,
|
raindropLength: 1.2,
|
||||||
cycleFrameSkip: 3,
|
cycleFrameSkip: 3,
|
||||||
fallSpeed: 0.5,
|
fallSpeed: 0.5,
|
||||||
cycleStyle: "cycleRandomly",
|
cycleStyleName: "cycleRandomly",
|
||||||
slant: Math.PI * -0.0625,
|
slant: Math.PI * -0.0625,
|
||||||
paletteEntries: [
|
paletteEntries: [
|
||||||
{ hsl: [0.15, 0.25, 0.9], at: 0.0 },
|
{ hsl: [0.15, 0.25, 0.9], at: 0.0 },
|
||||||
@@ -209,7 +215,7 @@ const versions = {
|
|||||||
numColumns: 50,
|
numColumns: 50,
|
||||||
raindropLength: 0.9,
|
raindropLength: 0.9,
|
||||||
fallSpeed: 0.1,
|
fallSpeed: 0.1,
|
||||||
cycleStyle: "cycleRandomly",
|
cycleStyleName: "cycleRandomly",
|
||||||
highPassThreshold: 0.0,
|
highPassThreshold: 0.0,
|
||||||
hasSun: true,
|
hasSun: true,
|
||||||
paletteEntries: [
|
paletteEntries: [
|
||||||
@@ -225,7 +231,7 @@ const versions = {
|
|||||||
font: "resurrections",
|
font: "resurrections",
|
||||||
numColumns: 20,
|
numColumns: 20,
|
||||||
fallSpeed: 0.35,
|
fallSpeed: 0.35,
|
||||||
cycleStyle: "cycleRandomly",
|
cycleStyleName: "cycleRandomly",
|
||||||
cycleSpeed: 0.8,
|
cycleSpeed: 0.8,
|
||||||
glyphEdgeCrop: 0.1,
|
glyphEdgeCrop: 0.1,
|
||||||
ditherMagnitude: 0,
|
ditherMagnitude: 0,
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ export default ({ regl, config, lkg }) => {
|
|||||||
...extractEntries(config, [
|
...extractEntries(config, [
|
||||||
"brightnessThreshold",
|
"brightnessThreshold",
|
||||||
"brightnessOverride",
|
"brightnessOverride",
|
||||||
|
"baseBrightness",
|
||||||
|
"baseContrast",
|
||||||
"brightnessDecay",
|
"brightnessDecay",
|
||||||
"cursorEffectThreshold",
|
"cursorEffectThreshold",
|
||||||
"cycleSpeed",
|
"cycleSpeed",
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ uniform float animationSpeed, fallSpeed, cycleSpeed;
|
|||||||
uniform bool hasSun, hasThunder, loops;
|
uniform bool hasSun, hasThunder, loops;
|
||||||
uniform bool showComputationTexture;
|
uniform bool showComputationTexture;
|
||||||
uniform float brightnessOverride, brightnessThreshold, brightnessDecay;
|
uniform float brightnessOverride, brightnessThreshold, brightnessDecay;
|
||||||
|
uniform float baseContrast, baseBrightness;
|
||||||
uniform float raindropLength, glyphHeightToWidth;
|
uniform float raindropLength, glyphHeightToWidth;
|
||||||
uniform int cycleStyle, rippleType;
|
uniform int cycleStyle, rippleType;
|
||||||
uniform float rippleScale, rippleSpeed, rippleThickness;
|
uniform float rippleScale, rippleSpeed, rippleThickness;
|
||||||
@@ -63,7 +64,7 @@ float getBrightness(float rainTime) {
|
|||||||
if (loops) {
|
if (loops) {
|
||||||
value = 1. - fract(rainTime);
|
value = 1. - fract(rainTime);
|
||||||
}
|
}
|
||||||
return log(value * 1.25) * 3.;
|
return value * baseContrast + baseBrightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
float getCycleSpeed(float rainTime, float brightness) {
|
float getCycleSpeed(float rainTime, float brightness) {
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ struct Config {
|
|||||||
brightnessThreshold : f32,
|
brightnessThreshold : f32,
|
||||||
brightnessOverride : f32,
|
brightnessOverride : f32,
|
||||||
brightnessDecay : f32,
|
brightnessDecay : f32,
|
||||||
|
baseBrightness : f32,
|
||||||
|
baseContrast : f32,
|
||||||
cursorEffectThreshold : f32,
|
cursorEffectThreshold : f32,
|
||||||
cycleSpeed : f32,
|
cycleSpeed : f32,
|
||||||
cycleFrameSkip : i32,
|
cycleFrameSkip : i32,
|
||||||
@@ -140,7 +142,7 @@ fn getBrightness(rainTime : f32) -> f32 {
|
|||||||
if (bool(config.loops)) {
|
if (bool(config.loops)) {
|
||||||
value = 1.0 - fract(rainTime);
|
value = 1.0 - fract(rainTime);
|
||||||
}
|
}
|
||||||
return log(value * 1.25) * 3.0;
|
return value * config.baseContrast + config.baseBrightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn getCycleSpeed(rainTime : f32, brightness : f32) -> f32 {
|
fn getCycleSpeed(rainTime : f32, brightness : f32) -> f32 {
|
||||||
|
|||||||
Reference in New Issue
Block a user