diff --git a/src/audio.js b/src/audio.js index d0c5edc..3f2aed4 100644 --- a/src/audio.js +++ b/src/audio.js @@ -16,6 +16,7 @@ module.exports = function(gl) { audio.loop = true audio.addEventListener('canplay', function() { audio.play() + audio.currentTime = 40 }, false) }) diff --git a/src/shader.js b/src/shader.js index 8df695c..8765a3b 100644 --- a/src/shader.js +++ b/src/shader.js @@ -11,8 +11,12 @@ const glslify = require('glslify') module.exports = function(gl) { const vert = glslify('./shaders/point.vert') const frag = glslify('./shaders/point.frag') - console.log(vert) - console.log(gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) + + var images = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS) + if (images <= 0) { + alert("Sorry, this demo isn't ready for your device yet!") + console.error("no vertex texture image units") + } const shader = createShader(gl, vert, frag) diff --git a/src/shaders/point.vert b/src/shaders/point.vert index 42d4bfe..bbea256 100644 --- a/src/shaders/point.vert +++ b/src/shaders/point.vert @@ -26,7 +26,7 @@ void main() { amplitude = ease(amplitude); vec4 npos = vec4(vpos, sin(iGlobalTime * sin(2.85 * mult.x))); - npos.x += amplitude*0.1; + npos.x += amplitude*0.3; float fade = 1.0; @@ -46,6 +46,6 @@ void main() { uv = sUv; uv.y = 1.0 - sUv.y; - gl_PointSize = dist * POINT_SIZE + amplitude*0.1; + gl_PointSize = dist * POINT_SIZE + amplitude*0.05; // uv *= 1.5; } \ No newline at end of file