Browse Source

some shader tweaks making the time go round and round

main
heck 2 years ago
parent
commit
760c3a2b4e
  1. 21
      html/index.html

21
html/index.html

@ -77,18 +77,19 @@
blend.x), blend.x),
blend.y blend.y
); );
return noiseVal / 0.7;// normalize to about [-1..1] return noiseVal / 0.7;
} }
void mainImage(out vec4 fragColor, in vec2 fragCoord) { void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.y; vec2 uv = fragCoord.xy / iResolution.y;
float time = iTime * (iTime * 0.1);
vec2 uvm = iMouse.xy / iResolution.y; vec2 uvm = iMouse.xy / iResolution.y;
float noiseVal = 0.5 + 0.5 * Pseudo3dNoise(vec3(uv *6.0, time/10.));
float time = (80.-(1.*uvm.y)) * sin(iTime / 30000.);
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.)); float val = sin(noiseVal * time + (sin(time) * time / 10.));
fragColor.rgba = vec4(val, val, val, 1.); fragColor.rgba = vec4(vec3(val), 1.0);
} }
void main() { void main() {
@ -99,8 +100,6 @@
<style> <style>
body { body {
background-color: black; background-color: black;
} }
.shaderhero { .shaderhero {
@ -118,7 +117,7 @@
z-index: -100; z-index: -100;
width: 100%; width: 100%;
height: 100%; height: 100%;
opacity: 1. opacity: 0.9;
} }
.shadercontainer { .shadercontainer {
@ -231,8 +230,8 @@
function onPointerMove(event) { function onPointerMove(event) {
var clientX = event.clientX; var clientX = event.clientX;
var clientY = event.clientY; var clientY = event.clientY;
var mouseX = clientX / window.innerWidth; var mouseX = clientX;
var mouseY = 1 - clientY / window.innerHeight; var mouseY = 1 - clientY;
uniforms[ 'iMouse' ].value = new THREE.Vector2(mouseX, mouseY); uniforms[ 'iMouse' ].value = new THREE.Vector2(mouseX, mouseY);
} }
@ -255,7 +254,7 @@
uniforms['iResolution'].value = new THREE.Vector2( canvas.clientWidth / downsample_quality, canvas.clientHeight / downsample_quality ); uniforms['iResolution'].value = new THREE.Vector2( canvas.clientWidth / downsample_quality, canvas.clientHeight / downsample_quality );
} }
uniforms[ 'iTime' ].value = performance.now() / 1000; uniforms[ 'iTime' ].value = performance.now();
renderer.render( scene, camera ); renderer.render( scene, camera );
} }

Loading…
Cancel
Save