提交 177bf99a 编写于 作者: M Mugen87

Examples: Use single buffer in sound visualizer

上级 fb58da04
......@@ -133,7 +133,7 @@
var size = fftSize / 2;
uniforms = {
tAudioData: { value: new THREE.DataTexture( new Uint8Array( size * 3 ), size, 1, THREE.RGBFormat ) }
tAudioData: { value: new THREE.DataTexture( analyser.data, size, 1, THREE.LuminanceFormat ) }
};
var material = new THREE.ShaderMaterial( {
......@@ -173,14 +173,6 @@
var data = analyser.getFrequencyData();
// transfer all frequency data to our data texture so we can use them in the fragment shader
for ( var i = 0, l = data.length; i < l; i ++ ) {
uniforms.tAudioData.value.image.data[ i * 3 ] = data[ i ];
}
uniforms.tAudioData.value.needsUpdate = true;
renderer.render( scene, camera );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册