Skip to content

Commit

Permalink
audio data
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdesl committed Apr 15, 2015
1 parent 758586d commit ace1d27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = function(gl) {
audio.loop = true
audio.addEventListener('canplay', function() {
audio.play()
audio.currentTime = 40
}, false)
})

Expand Down
8 changes: 6 additions & 2 deletions src/shader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/shaders/point.vert
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}

0 comments on commit ace1d27

Please sign in to comment.