Resurrections version now vertically spaces the glyphs (groan).

This commit is contained in:
Rezmason
2021-10-22 22:56:11 -07:00
parent 6d8f5ba41a
commit 1a97861fed
4 changed files with 14 additions and 17 deletions

View File

@@ -1,23 +1,19 @@
TODO: TODO:
Improve forkability Improve forkability
Refactor rainPass.compute's sin(sqrt(5)) stuff, there must be a clearer expression
Document every variable, method, and section of the main function in rainPass.compute Write an explanation of the rain pass (and include images)
Maybe rewrite it? Make the time based stuff easier to read? Compute
Volumetric quads
Write a document (and include images) that explains the underlying principle of the rain pass Fullscreen quad and spacial mapping
MSDFs
Is the pipeline stuff just too bizarre?
Resurrection Resurrection
Modified glyph order? Modified glyph order?
New glyphs? New glyphs?
Good luck with that, champ Good luck with that, champ
Audio Audio
Synthesize raindrop sound Synthesize raindrop sound
Use WebAudio to mess with it Use WebAudio to mess with it

View File

@@ -38,6 +38,7 @@ const defaults = {
fallSpeed: 1, // The speed the raindrops progress downwards fallSpeed: 1, // 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
hasSun: false, // Makes the glyphs more radiant. Admittedly not very technical. hasSun: false, // Makes the glyphs more radiant. Admittedly not very technical.
hasThunder: false, // An effect that adds dramatic lightning flashes hasThunder: false, // An effect that adds dramatic lightning flashes
isPolar: false, // Whether the glyphs arc across the screen or sit in a standard grid isPolar: false, // Whether the glyphs arc across the screen or sit in a standard grid
@@ -74,7 +75,7 @@ const versions = {
cycleFrameSkip: 6, cycleFrameSkip: 6,
cycleStyleName: "cycleRandomly", cycleStyleName: "cycleRandomly",
cursorEffectThreshold: 0.64, cursorEffectThreshold: 0.64,
brightnessOverride: 0.25, brightnessOverride: 0.22,
brightnessThreshold: -1.0, brightnessThreshold: -1.0,
fallSpeed: 0.65, fallSpeed: 0.65,
glyphEdgeCrop: 0.15, glyphEdgeCrop: 0.15,
@@ -132,12 +133,11 @@ const versions = {
...defaults, ...defaults,
...fonts.matrixcode, ...fonts.matrixcode,
resurrectingCodeRatio: 0.25, resurrectingCodeRatio: 0.25,
glyphVerticalSpacing: 1.25,
effect: "resurrections", effect: "resurrections",
width: 100, numColumns: 100,
volumetric: true, volumetric: true,
density: 1.5, cycleSpeed: 0.5,
fallSpeed: 1.2,
raindropLength: 1.25,
}, },
}; };
versions.throwback = versions.operator; versions.throwback = versions.operator;

View File

@@ -108,6 +108,7 @@ export default (regl, config) => {
...extractEntries(config, [ ...extractEntries(config, [
// vertex // vertex
"forwardSpeed", "forwardSpeed",
"glyphVerticalSpacing",
// fragment // fragment
"glyphEdgeCrop", "glyphEdgeCrop",
"isPolar", "isPolar",

View File

@@ -4,7 +4,7 @@ attribute vec2 aPosition, aCorner;
uniform sampler2D lastState; uniform sampler2D lastState;
uniform float density; uniform float density;
uniform vec2 quadSize; uniform vec2 quadSize;
uniform float glyphHeightToWidth; uniform float glyphHeightToWidth, glyphVerticalSpacing;
uniform mat4 camera, transform; uniform mat4 camera, transform;
uniform vec2 screenSize; uniform vec2 screenSize;
uniform float time, animationSpeed, forwardSpeed; uniform float time, animationSpeed, forwardSpeed;
@@ -32,7 +32,7 @@ void main() {
quadDepth = fract(vGlyph.b + time * animationSpeed * forwardSpeed); quadDepth = fract(vGlyph.b + time * animationSpeed * forwardSpeed);
vGlyph.b = quadDepth; vGlyph.b = quadDepth;
} }
vec2 position = (aPosition + aCorner * vec2(density, 1.)) * quadSize; vec2 position = (aPosition * vec2(1., glyphVerticalSpacing) + aCorner * vec2(density, 1.)) * quadSize;
vec4 pos = vec4((position - 0.5) * 2.0, quadDepth, 1.0); vec4 pos = vec4((position - 0.5) * 2.0, quadDepth, 1.0);
// "Resurrected" columns are in the green channel, // "Resurrected" columns are in the green channel,