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:
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
Maybe rewrite it? Make the time based stuff easier to read?
Write a document (and include images) that explains the underlying principle of the rain pass
Is the pipeline stuff just too bizarre?
Write an explanation of the rain pass (and include images)
Compute
Volumetric quads
Fullscreen quad and spacial mapping
MSDFs
Resurrection
Modified glyph order?
New glyphs?
Good luck with that, champ
Audio
Synthesize raindrop sound
Use WebAudio to mess with it

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ attribute vec2 aPosition, aCorner;
uniform sampler2D lastState;
uniform float density;
uniform vec2 quadSize;
uniform float glyphHeightToWidth;
uniform float glyphHeightToWidth, glyphVerticalSpacing;
uniform mat4 camera, transform;
uniform vec2 screenSize;
uniform float time, animationSpeed, forwardSpeed;
@@ -32,7 +32,7 @@ void main() {
quadDepth = fract(vGlyph.b + time * animationSpeed * forwardSpeed);
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);
// "Resurrected" columns are in the green channel,