Browse Source

Fix: it was the alpha value, weird that seems to be handled implementation defined.

main
heck 2 years ago
parent
commit
b4ad120971
  1. 13
      html/index.html

13
html/index.html

@ -12,17 +12,18 @@
} }
</script> </script>
<script id="fragmentShader" type="x-shader/x-fragment"> <script id="fragmentShader" type="x-shader/x-fragment">
#ifdef GL_FRAGMENT_PRECISION_HIGH #ifdef GL_ES
precision highp float; precision highp float;
#else
precision mediump float;
#endif #endif
// #extension GL_OES_standard_derivatives : enable
uniform float iTime; uniform float iTime;
uniform vec2 iMouse; uniform vec2 iMouse;
uniform vec2 iResolution; uniform vec2 iResolution;
uniform sampler2D iChannel0; uniform sampler2D iChannel0;
vec2 GetGradient(vec2 intPos, float t) { vec2 GetGradient(vec2 intPos, float t) {
float rand = texture(iChannel0, intPos / 64.0).r * 4.0; float rand = texture(iChannel0, intPos / 64.0).r * 4.0;
float angle = 6.283185 * rand + 4.0 * t * rand; float angle = 6.283185 * rand + 4.0 * t * rand;
@ -55,7 +56,8 @@
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 noiseVal = 0.5 + 0.5 * Pseudo3dNoise(vec3(uv *6.0, time/10.));
fragColor.rgb = vec3( 0.8+ 0.2*sin(noiseVal * time + (sin(time) * time / 10.))); float val = sin(noiseVal * time + (sin(time) * time / 10.));
fragColor.rgba = vec4( val, val, val, 1.);
} }
void main() { void main() {
@ -127,13 +129,12 @@
function animate() { function animate() {
window.requestAnimationFrame( animate ); requestAnimationFrame( animate );
uniforms[ 'iTime' ].value = performance.now() / 1000; uniforms[ 'iTime' ].value = performance.now() / 1000;
renderer.render( scene, camera ); renderer.render( scene, camera );
} }
</script> </script>
</body> </body>
</html> </html>

Loading…
Cancel
Save