subfactory.ch website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

695 lines
28 KiB

<!DOCTYPE html>
<html lang="de">
<head>
<title>Sub Factory</title>
<a id="focus" href="#focus"></a>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="./resources/favicon.png">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css">
<link rel="stylesheet" href="css/fontred.css">
<!-- Shaders -->
<script id="vertexShader" type="x-shader/x-vertex">
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = vec4(position, 1.0);
}
</script>
<script id="fragmentShader" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
// #extension GL_OES_standard_derivatives : enable
uniform float iTime;
uniform vec2 iMouse;
uniform vec2 iResolution;
uniform sampler2D iChannel0;
uniform int shadervariation;
vec2 GetGradient(vec2 intPos, float t) {
float rand = texture(iChannel0, intPos / 64.0).r * 4.0;
float angle = 6.283185 * rand + 4.0 * t * rand;
return vec2(cos(angle), sin(angle));
}
float Pseudo3dNoise(vec3 pos) {
vec2 i = floor(pos.xy);
vec2 f = pos.xy - i;
vec2 blend = f * f * (3.0 -(2.0 * f));
float noiseVal =
mix(
mix(
dot(GetGradient(i + vec2(0, 0), pos.z), f - vec2(0, 0)),
dot(GetGradient(i + vec2(1, 0), pos.z), f - vec2(1, 0)),
blend.x),
mix(
dot(GetGradient(i + vec2(0, 1), pos.z), f - vec2(0, 1)),
dot(GetGradient(i + vec2(1, 1), pos.z), f - vec2(1, 1)),
blend.x),
blend.y
);
return noiseVal / 0.7;
}
float fsin(in float x)
{
float w = fwidth(x);
return sin(x) * smoothstep(6.2832, 0.0, w);
}
float fcos(in float x)
{
float w = fwidth(x);
return cos(x) * smoothstep(6.2832, 0.0, w);
}
///////////////////
// SHADER variationS
///////////////////
void hallucinate_1(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float time = 20.98 - (100000. * mod(pow(sin(iTime / 20000000.), 2.), 1.));
float noiseVal = Pseudo3dNoise(vec3(uv, time));
// float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/1.));
float time2 = 10000. - (20000. * pow(cos(iTime / noiseVal/32400.), 2.));
float val = sin(noiseVal * time + (sin(time) * time / 10.));
val = 18./time2/val;
val *= 0.25;
fragColor.rgba = vec4(val,0.,0.,1.0);
}
void hallucinate_2(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float time = 30.+(3. * pow(cos(iTime / 23000.),2.));
float noiseVal = Pseudo3dNoise(vec3(uv, time));
float time2 = 3.+(3000. * pow(cos(iTime / noiseVal/3000.),2.));
// float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/10.));
float val = sin(noiseVal * time + (sin(time) * time / 10.));
val = 2./time2/val;
val *= 0.4;
fragColor.rgba = vec4(val,0.,0.,1.0);
}
void bentorbits(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float time = 20.98 - (.33 * mod(pow(fsin(iTime / 150000.), 2.), 1.));
float noiseVal = Pseudo3dNoise(vec3(uv, time));
// float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/1.));
float time2 = 10000. - (20000. * pow(fcos(iTime / noiseVal/64400.), 2.));
float val = fsin(noiseVal * time + (fsin(time) * time / 10.));
val =180./time2/val;
val *= 0.1;
fragColor.rgba = vec4(val,0.,0.,1.0);
}
void debris(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float tstart = 300000. + iTime;
float t = 300000.+ pow(tstart,2.)*1000.;
float time = 400.98 - (.33 * mod(pow(sin(t * 1500000.), 2.), 1.));
float noiseVal = Pseudo3dNoise(vec3(uv, time));
// float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/1.));
// float time2 = 10000. - (20000. * pow(fcos(t / noiseVal/64400.), 2.));
float time2 = 10000. - (20000. * pow(cos(t / noiseVal/6440000.), 2.));
float val = sin((noiseVal * time + (sin(time2*100.) * time2/100000000.))/.001);
fragColor.rgba = vec4(.001/time2/val, 0., 0., 1.0);
}
void decorationgoeslsd(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float time = 0.98+(20. * pow(cos(iTime / 200000.),2.));
float noiseVal = Pseudo3dNoise(vec3(uv, time));
// float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/1.));
float time2 = 3.+(3000. * pow(cos(iTime / noiseVal/440000.),2.));
float val = sin(noiseVal * time + (sin(time) * time / 10.));
val = 18./time2/val;
val *= 0.12;
fragColor.rgba = vec4(val,0.,0.,1.0);
}
void camousmudgy(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float tstart = 600. + iTime;
float t = pow(tstart,1.9)*100.;
float time = 0.98 - (.33 * mod(pow(sin(t * 1500.), 2.), 1.));
// float noiseVal = Pseudo3dNoise(vec3(uv, time));
float noiseVal = (time/1000.) * Pseudo3dNoise(vec3(uv * 6., time/1.));
float time2 = 10000. - (20000. * pow(cos(t / noiseVal/64400.), 2.));
// float time2 = 10000. - (20000. * pow(cos(t * noiseVal/10.), 2.));
float val = sin((noiseVal * time + (sin(time2*100.) * time2/100000000.))/.001);
val =smoothstep(0.,t/100000000.,0.001*time2/val);
val *= 0.3;
fragColor.rgba = vec4(val, 0., 0., 1.0);
}
void flashsmudgy(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float time = 30.+(3. * pow(cos(iTime / 23000.), 2.));
//float noiseVal = Pseudo3dNoise(vec3(uv, time));
float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/10.));
float time2 = 3.+(3000. * pow(cos(iTime / noiseVal/300.), 2.));
float at = iTime/300.;
float am = 0.;
am = max(am, 0.8 - pow(mod(at, 200.), 1.));
am = max(am, 1.- pow(mod(at, 17.), .7));
am = max(am, 1.- pow(mod(at, 13.), 1.));
am = max(am, .5- pow(mod(at, 47.), 100.));
am = max(am, 1.- pow(mod(at, 257.), 257.));
am *= (pow(mod(at, 257.), 1.));
am = 1. - am;
float val = sin(noiseVal * time + (sin(time) * time / 10.));
val =am * (2./time2/val);
val *= 0.06;
fragColor.rgba = vec4(val, 0., 0., 1.0);
}
void interfields(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float tstart = 6000. + iTime;
float t = pow(tstart,2.)*100.;
float time = 0.98 - (.33 * mod(pow(sin(t * 1500.), 2.), 1.));
// float noiseVal = Pseudo3dNoise(vec3(uv, time));
float noiseVal = 0.5 + 0.1 + (time/1000.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/1.));
float time2 = 10000. - (20000. * pow(cos(t / noiseVal/64400.), 2.));
// float time2 = 10000. - (20000. * pow(cos(t * noiseVal/10.), 2.));
float val = sin((noiseVal * time + (sin(time2*100.) * time2/100000000.))/.001);
fragColor.rgba = vec4(smoothstep(0.,t/100000000.,0.001*time2/val), 0., 0., 1.0);
}
void flashbang(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float tstart = 600. + iTime;
float t = pow(tstart,2.)*100.;
float time = 0.98 - (.33 * mod(pow(sin(t * 1500.), 2.), 1.));
// float noiseVal = Pseudo3dNoise(vec3(uv, time));
float noiseVal = 0.5 + 0.1 + (time/100000.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/1.));
float time2 = 10000. - (20000. * pow(cos(t / noiseVal/64400.), 2.));
// float time2 = 10000. - (20000. * pow(cos(t * noiseVal/10.), 2.));
float val = sin((noiseVal * time + (sin(time2*100.) * time2/100000000.))/.001);
fragColor.rgba = vec4(smoothstep(0.,t/100000000.,0.001*time2/val), 0., 0., 1.0);
}
void glitchbang(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float t = pow(iTime,3.0);
float time = 20.98+(t/2000000.) - (11111111.33 * mod(pow(fsin(t / 150000.), 2.), 1.));
float noiseVal = Pseudo3dNoise(vec3(uv, time));
// float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/1.));
float time2 = 10000. - (20000. * pow(cos(t / noiseVal/64400.), 2.));
float val = sin(noiseVal * time + (fsin(time) * time / 10.));
fragColor.rgba = vec4(180./time2/val, 0., 0., 1.0);
}
void jitterbang(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float t = 100000000000000000000./pow(iTime,4.0);
float time = 20.98 - (11111111.33 * mod(pow(fsin(t / 150000.), 2.), 1.));
float noiseVal = Pseudo3dNoise(vec3(uv, time));
// float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/1.));
float time2 = 10000. - (20000. * pow(cos(t / noiseVal/64400.), 2.));
float val = sin(noiseVal * time + (fsin(time) * time / 10.));
fragColor.rgba = vec4(180./time2/val, 0., 0., 1.0);
}
void noiseinfection(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float tstart = 2000. + iTime;
float t = pow(tstart,1.9)*100.;
float time = 0.98 - (.33 * mod(pow(sin(t * 1500.), 2.), 1.));
float noiseVal = Pseudo3dNoise(vec3(uv*20., time/1000.));
float time2 = 10000. - (20000. * pow(cos(t / noiseVal/64400.), 2.));
noiseVal = (time/1000.) * Pseudo3dNoise(vec3(uv * 7., time*100.));
// float time2 = 10000. - (20000. * pow(cos(t * noiseVal/10.), 2.));
float val = sin((noiseVal * time + (sin(time2*100.) * time2/100000000.))/.001);
val = smoothstep(0.,t/100000000.,0.001*time2/val);
val *= 0.3;
fragColor.rgba = vec4(val, 0., 0., 1.0);
}
void orion(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y;
vec2 uvm = iMouse.xy / iResolution.y;
float t = iTime;
float time = 20.98 - (.33 * mod(pow(sin(t / 150000.), 2.), 1.));
float noiseVal = Pseudo3dNoise(vec3(uv, time));
// float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/1.));
// float time2 = 10000. - (20000. * pow(fcos(t / noiseVal/64400.), 2.));
float time2 = 10000. - (20000. * pow(cos(t / noiseVal/64400.), 2.));
float val = sin((noiseVal * time + (sin(time) * time))*100.);
val =180./time2/val;
val *= 0.3;
fragColor.rgba = vec4(val, 0., 0., 1.0);
}
void tvshutdown(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv;
uv.x = abs((fragCoord.x - (iResolution.x / 2.))/ (iResolution.x / 2.));
uv.y = abs((fragCoord.y - (iResolution.y / 2.)) / (iResolution.y / 2.));
vec2 uvm;
uvm.x = (iMouse.x - (iResolution.x / 2.)) / (iResolution.x / 2.);
uvm.y = ((iResolution.y - iMouse.y) / (iResolution.y*2.));
float toffset = uvm.y*1000. + iTime;
float tshape = pow(toffset, 2.2)*500.;
float tloop = mod(tshape, 100000000000.);
float t = tloop;
float time = 10.98 - (.33 * mod(pow(sin(t * 1500.), 2.), 1.));
float noiseVal = Pseudo3dNoise(vec3(uv*t/200., time));
float time2 = 10000. - (20000. * pow(cos(t / noiseVal/64400.), 2.));
// float time2 = 10000. - (20000. * pow(cos(t * noiseVal/10.), 2.));
float val = sin((noiseVal * time + (sin(time2*100.) * time2/100000000.))/.001);
fragColor.rgba = vec4(smoothstep(0., t/100000000., 0.001*time2/val), 0., 0., 1.0);
}
void main() {
if(shadervariation == 0) {
hallucinate_1(gl_FragColor, gl_FragCoord.xy);
}
if(shadervariation == 1) {
orion(gl_FragColor, gl_FragCoord.xy);
}
if(shadervariation == 2) {
hallucinate_2(gl_FragColor, gl_FragCoord.xy);
}
if(shadervariation == 3) {
camousmudgy(gl_FragColor, gl_FragCoord.xy);
}
if(shadervariation == 4) {
flashsmudgy(gl_FragColor, gl_FragCoord.xy);
}
if(shadervariation == 5) {
noiseinfection(gl_FragColor, gl_FragCoord.xy);
}
if(shadervariation == 6) {
jitterbang(gl_FragColor, gl_FragCoord.xy);
}
if(shadervariation == 7) {
flashbang(gl_FragColor, gl_FragCoord.xy);
// glitchbang(gl_FragColor, gl_FragCoord.xy);
}
if(shadervariation == 8) {
tvshutdown(gl_FragColor, gl_FragCoord.xy);
}
// debris(gl_FragColor, gl_FragCoord.xy);
// decorationgoeslsd(gl_FragColor, gl_FragCoord.xy);
// bentorbits(gl_FragColor, gl_FragCoord.xy);
// interfields(gl_FragColor, gl_FragCoord.xy);
}
</script>
</head>
<body>
<div class="brightnessdiv"></div>
<div class="toningdiv"></div>
<canvas id="hecksshader"></canvas>
<div class="aliasingdiv"></div>
<div class="container">
<br>
<div class="img flyer">
<img src="resources/Sub_Factory_2025.webp" alt="Subfactory Banner">
</div>
<div class="cardcontainer pt-2">
<h2 class="text-center presentedby">Präsentiert von</h2>
<div class="card-group pt-2">
<div class="card shadow-none">
<div class="card-body text-center">
<div class="fix_height">
<h2>Eulachbass</h2>
</div>
<img class="logo" src="resources/eulachbass_logo_white.webp" alt="Eulachbass Logo">
<a href="https://eulachbass.ch/" target="_blank" class="card-link">
<i class="fas fa-globe mr-2"></i>
</a>
<a href="https://www.instagram.com/eulachbass" target="_blank" class="card-link">
<i class="fab fa-instagram mr-2"></i>
</a>
<a href="https://www.facebook.com/eulachbass/" target="_blank" class="card-link">
<i class="fab fa-facebook mr-2"></i>
</a>
<a href="https://soundcloud.com/eulachbass" target="_blank" class="card-link">
<i class="fab fa-soundcloud mr-2"></i>
</a>
</div>
</div>
<div class="card shadow-none">
<div class="card-body text-center">
<div class="fix_height">
<h2>Sector B</h2>
</div>
<img class="logo" src="resources/sectorb_logo_white.webp" alt="Sector B Logo">
<a href="https://www.instagram.com/sectorbevents/" target="_blank" class="card-link">
<i class="fab fa-instagram mr-2"></i>
</a>
<a href="https://www.facebook.com/sectorbevents/" target="_blank" class="card-link">
<i class="fab fa-facebook mr-2"></i>
</a>
</div>
</div>
<div class="card shadow-none">
<div class="card-body text-center">
<div class="fix_height">
<h2>Subsanity</h2>
</div>
<img class="logo" src="resources/subsanity_logo.webp" alt="Subsanity Logo">
<a href="https://www.instagram.com/subsanitysoundsystem" target="_blank" class="card-link">
<i class="fab fa-instagram mr-2"></i>
</a>
<a href="https://www.facebook.com/subsanitysound" target="_blank" class="card-link">
<i class="fab fa-facebook mr-2"></i>
</a>
<a href="https://soundcloud.com/user-937924022" target="_blank" class="card-link">
<i class="fab fa-soundcloud mr-2"></i>
</a>
<br>
<br>
</div>
</div>
</div>
</div>
<!-- INFO -->
<div class="cardcontainer pt-2">
<div class="card">
<div class="card-body col-12 section">
<h2 class="text-center">Info</h2>
<p>
Streiche dir den 21. Juni 2025 im Kalender fett an! Von 14:00 bis 22:00 findet auf dem Areal der
Gleiserei in Winterthur zum dritten mal unser Drum & Bass Day Rave statt. Zu Gast sind FD (UK),
Namarone (Fribourg) und anotha90skid (St. Gallen). Unterstützt werden sie von DJs aus unseren
eigenen Reihen
(Sector B und Eulachbass).
Eintritt frei – Spenden willkommen!
</p>
</div>
</div>
</div>
<!-- Anreise -->
<div class="cardcontainer pt-2">
<div class="card">
<div class="card-body col-12 section">
<h2 class="text-center ">Anreise</h2>
<p>
Einfach "Gleiserei" in dein navi of choice eingeben.
<iframe width="100%" height="350" class="osmmap"
src="https://www.openstreetmap.org/export/embed.html?bbox=8.723748028278353%2C47.50513122763665%2C8.727449476718904%2C47.507049991528696&amp;layer=mapnik&amp;marker=47.506090618350065%2C8.725598752498627"
style="border: 1px solid black"></iframe>
<br/><small><a
href="https://www.openstreetmap.org/?mlat=47.506091&amp;mlon=8.725599#map=19/47.506091/8.725599">View
Larger Map</a></small>
</p>
</div>
</div>
</div>
<!-- Zahlungsmethoden -->
<div class="cardcontainer pt-2">
<div class="card ">
<div class="card-body col-12 section">
<h2 class="text-center ">Zahlungsmöglichkeiten</h2>
<p>
Bei uns kann mit Bargeld oder Twint bezahlt werden.
</p>
</div>
</div>
</div>
<!-- Rave Etiquette -->
<div class="cardcontainer pt-2">
<div class="card">
<div class="card-body col-12 section">
<h2 class="text-center ">Rave Etiquette</h2>
<p>Mit der Teilnahme an der Sub Factory übernimmst du Verantwortung für dein Verhalten und
gestaltest den Anlass aktiv mit:</p>
<ul>
<li>Konsens - nur ja heisst ja</li>
<p>Respektiere physische und emotionale Grenzen. Die Grenzen aller Menschen sind individuell
und können sich jederzeit ändern. Frage immer nach Zustimmung. Das gilt auch beim
Fotografieren.</p>
<li>Für einander da</li>
<p>Wir kümmern uns um unsere Freund:innen, die Menschen um uns herum und um uns selbst.
Siehst du eine Situation, in der du denkst, dass sich eine Person nicht wohl fühlt: Frag nach!
Jede Person definiert für sich selbst, wann eine Grenze überschritten ist. Falls du selbst mit
der
Situation überfordert bist, kannst du Hilfe beim Ordnungsdienst holen.</p>
<li>Keine Annahmen</li>
<p>Vermeide Annahmen und daraus entstehende Fragen und Urteile über die Geschlechtsidentität,
sexuelle Orientierung, Herkunft oder soziale Zugehörigkeit einer Person.</p>
<li>Kenne deine Grenzen</li>
<p>Sei achtsam, wenn du Alkohol und ander Rauschmittel konsumierst. Stelle sicher, dass du
deine eigenen und die Grenzen anderer Personen noch wahrnehmen und respektieren kannst.
<br>
Fühlst du dich unwohl oder brauchst du Unterstützung? Wende dich an den Ordnungsdienst.
Sie können dir weiterhelfen oder einen ruhigen Ort anbieten.
</p>
</ul>
</div>
</div>
</div>
<!-- Partner -->
<div class="cardcontainer pt-2">
<div class="card">
<div class="card-body col-12 section">
<h2 class="text-center ">Partner</h2>
<p class="text-center">
<a href="https://www.gleiserei.ch/" target="_blank">Gleiserei</a><br>
<a href="https://www.hakogetraenke.ch/" target="_blank">Hako Getränke</a>
</p>
</div>
</div>
</div>
</div>
<!--<script>-->
<!-- document.getElementById("focus").focus();-->
<!--</script>-->
<script type="module">
import * as THREE from 'https://unpkg.com/three/build/three.module.js';
let camera, scene, renderer;
let uniforms;
let texture;
let downsample_quality = 1.;
let perftime_offset = 0;
let variation_count = 10;
var shadervariation = 0;
function shadervariation_validate() {
if(shadervariation > variation_count-1) {
shadervariation = variation_count-1;
}
if(shadervariation < 0) {
shadervariation = 0;
}
}
function set_shadervariation(nr) {
console.log('set_shadervariation()');
shadervariation = nr;
shadervariation_validate();
console.log('requested:', nr, 'effective:', shadervariation);
}
function shadervariation_next() {
console.log('shadervariation_next()')
set_shadervariation(shadervariation + 1);
}
function shadervariation_prev() {
console.log('shadervariation_prev()')
set_shadervariation(shadervariation - 1);
}
document.addEventListener('keydown', function(event) {
const key = event.key; // e.g., "ArrowRight", "ArrowLeft", etc.
console.log(key);
switch (key) {
case "ArrowLeft":
shadervariation_prev();
init();
break;
case "ArrowRight":
shadervariation_next();
init();
break;
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
set_shadervariation(Number(key));
init();
break;
case "Escape":
init();
break;
}
});
function init() {
console.log('shader init with variation:', shadervariation );
camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
scene = new THREE.Scene();
const geometry = new THREE.PlaneGeometry( 2, 2 );
const loader = new THREE.TextureLoader();
const texture = loader.load('./resources/noise.png');
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
uniforms = {
iTime: { value: 1.0 },
iResolution: { value: new THREE.Vector2(1.0,1.0) },
iMouse: { value: new THREE.Vector2(0.0,0.0) },
iChannel0: { value: texture },
shadervariation: { value: shadervariation },
};
const material = new THREE.ShaderMaterial( {
uniforms: uniforms,
vertexShader: document.getElementById( 'vertexShader' ).textContent,
fragmentShader: document.getElementById( 'fragmentShader' ).textContent
} );
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
const canvas = document.querySelector('#hecksshader');
renderer = new THREE.WebGLRenderer({antialias: true, canvas});
document.addEventListener( 'pointermove', onPointerMove);
reset_perftime();
}
function onPointerMove(event) {
var clientX = event.clientX;
var clientY = event.clientY;
var mouseX = clientX;
var mouseY = 1 - clientY;
uniforms[ 'iMouse' ].value = new THREE.Vector2(mouseX, mouseY);
}
function rendererNeedsResize(renderer) {
const canvas = renderer.domElement;
const width = canvas.clientWidth;
const height = canvas.clientHeight;
const needResize = canvas.width !== width || canvas.height !== height;
return true;
}
function reset_perftime() {
perftime_offset = performance.now();
}
function get_perftime() {
return performance.now() - perftime_offset;
}
function render() {
requestAnimationFrame( render );
if (rendererNeedsResize(renderer)) {
const canvas = renderer.domElement;
renderer.setSize(canvas.clientWidth, canvas.clientHeight, false);
camera.aspect = canvas.clientWidth / canvas.clientHeight;
camera.updateProjectionMatrix();
uniforms['iResolution'].value = new THREE.Vector2( canvas.clientWidth / downsample_quality, canvas.clientHeight / downsample_quality );
}
uniforms[ 'iTime' ].value = get_perftime();
renderer.render( scene, camera );
}
init();
render();
</script>
</body>
</html>