mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-18 22:29:28 -07:00
Added paradise version. Added Coptic text texture. Added polar coordinate and "sun" support to the renderer.
This commit is contained in:
48
index.html
48
index.html
@@ -25,9 +25,36 @@
|
||||
<script>
|
||||
|
||||
const versions = {
|
||||
paradise: {
|
||||
texture: './coptic_msdf.png',
|
||||
glyphSequenceLength: 32,
|
||||
bloom: {
|
||||
strength: 4,
|
||||
radius: 1,
|
||||
threshold: 0
|
||||
},
|
||||
palette: [
|
||||
{color: new THREE.Vector3(0.00, 0.00, 0.00), at: 0.0},
|
||||
{color: new THREE.Vector3(0.52, 0.17, 0.05), at: 0.4},
|
||||
{color: new THREE.Vector3(0.82, 0.37, 0.12), at: 0.7},
|
||||
{color: new THREE.Vector3(1.00, 0.74, 0.29), at: 0.9},
|
||||
{color: new THREE.Vector3(1.00, 1.00, 1.00), at: 1.0},
|
||||
],
|
||||
fallSpeed: 0.05,
|
||||
cycleSpeed: 0.05,
|
||||
hasThunder: false,
|
||||
hasSun: true,
|
||||
isPolar: true,
|
||||
numColumns: 50
|
||||
},
|
||||
nightmare: {
|
||||
texture: './gothic_msdf.png',
|
||||
glyphSequenceLength: 27,
|
||||
bloom: {
|
||||
strength: 2,
|
||||
radius: 0.8,
|
||||
threshold: 0.5
|
||||
},
|
||||
palette: [
|
||||
{color: new THREE.Vector3(0.00, 0.00, 0.00), at: 0.0},
|
||||
{color: new THREE.Vector3(0.52, 0.00, 0.00), at: 0.2},
|
||||
@@ -36,13 +63,20 @@
|
||||
{color: new THREE.Vector3(1.00, 1.00, 0.90), at: 1.0},
|
||||
],
|
||||
fallSpeed: 0.4,
|
||||
cycleSpeed: 0.5,
|
||||
cycleSpeed: 0.02,
|
||||
hasThunder: true,
|
||||
hasSun: false,
|
||||
isPolar: false,
|
||||
numColumns: 60
|
||||
},
|
||||
["1999"]: {
|
||||
texture: './matrixcode_msdf.png',
|
||||
glyphSequenceLength: 57,
|
||||
bloom: {
|
||||
strength: 2,
|
||||
radius: 0.5,
|
||||
threshold: 0.3
|
||||
},
|
||||
palette: [
|
||||
{color: new THREE.Vector3(0.00, 0.00, 0.00), at: 0.0},
|
||||
{color: new THREE.Vector3(0.05, 0.52, 0.17), at: 0.4},
|
||||
@@ -52,6 +86,8 @@
|
||||
fallSpeed: 1,
|
||||
cycleSpeed: 1,
|
||||
hasThunder: false,
|
||||
hasSun: false,
|
||||
isPolar: false,
|
||||
numColumns: 80
|
||||
}
|
||||
};
|
||||
@@ -59,7 +95,7 @@
|
||||
const urlParams = new Map(window.location.href.replace(/^[^\?]+\?/, "").split("&").map(pair => pair.split("=")));
|
||||
const getParam = (key, defaultValue) => urlParams.has(key) ? urlParams.get(key) : defaultValue;
|
||||
|
||||
const version = versions[getParam("version", "1999")];
|
||||
const version = versions[getParam("version", "1999")] || versions["1999"];
|
||||
|
||||
const sharpness = parseFloat(getParam("sharpness", 0.5));
|
||||
const animationSpeed = parseFloat(getParam("animationSpeed", 1));
|
||||
@@ -70,6 +106,8 @@
|
||||
const glyphSequenceLength = version.glyphSequenceLength;
|
||||
const palette = version.palette;
|
||||
const hasThunder = version.hasThunder;
|
||||
const hasSun = version.hasSun;
|
||||
const isPolar = version.isPolar;
|
||||
|
||||
const effect = getParam("effect", "plain");
|
||||
|
||||
@@ -91,13 +129,15 @@
|
||||
animationSpeed, fallSpeed, cycleSpeed,
|
||||
glyphSequenceLength,
|
||||
numGlyphColumns,
|
||||
hasThunder
|
||||
hasThunder,
|
||||
hasSun,
|
||||
isPolar,
|
||||
});
|
||||
|
||||
matrixRenderer.pass.renderToScreen = false;
|
||||
composer.addPass( matrixRenderer.pass );
|
||||
|
||||
const bloomPass = new THREE.UnrealBloomPass( new THREE.Vector2( window.innerWidth, window.innerHeight ), 2, 0.5, 0.3 );
|
||||
const bloomPass = new THREE.UnrealBloomPass( new THREE.Vector2( window.innerWidth, window.innerHeight ), version.bloom.strength, version.bloom.radius, version.bloom.threshold );
|
||||
composer.addPass( bloomPass );
|
||||
|
||||
switch (effect) {
|
||||
|
||||
Reference in New Issue
Block a user