Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus| import { | |
| Box3, | |
| InstancedInterleavedBuffer, | |
| InterleavedBufferAttribute, | |
| Line3, | |
| MathUtils, | |
| Matrix4, | |
| Mesh, | |
| Sphere, | |
| Vector3, |
| #define sectorize(value) step(0.0, (value))*2.0-1.0 | |
| #define sum(value) dot(clamp((value), 1.0, 1.0), (value)) | |
| #define PI 3.141592653589793 | |
| vec2 normalToUvRectOct(vec3 normal){ | |
| normal /= sum(abs(normal)); | |
| if(normal.y > 0.0){ | |
| return normal.xz*0.5+0.5; | |
| } | |
| else{ |
| import { | |
| InstancedBufferGeometry, | |
| InstancedBufferAttribute, | |
| BufferAttribute, | |
| Vector3, |
| float when_fgt(float x, float y) { | |
| return max(sign(x - y), 0.0); | |
| } | |
| vec2 correctRatio(vec2 inUv, float baseratio, float asp){ | |
| return mix( | |
| vec2( | |
| inUv.x, |
| THREE.TransformationShader = { | |
| defines: {}, | |
| uniforms: { | |
| "tDiffuse": { type: "t", value: texture }, | |
| "opacity": { type: "f", value: 1.0 }, | |
| "translationX": { type: "f", value: 1.0 }, | |
| "translationY": { type: "f", value: 1.0 }, | |
| "translationZ": { type: "f", value: 1.0 }, | |
| "scaleX": { type: "f", value: 1.0 }, |
| // Uses getUserMedia to record audio from microphone, compresses it to mp3, and throws it away. | |
| // You should change the last step to e.g. pushing the audio to a server over a WebSocket. | |
| // This script uses lame.js for mp3 encoding | |
| // https://github.com/zhuker/lamejs | |
| var audioDataCallback = function(encodedData, originalData) { | |
| console.log("Encoded " + encodedData.byteLength + " bytes. Original: " + originalData.byteLength); | |
| }; |
| uniform sampler2D tex; | |
| varying vec2 vUv; | |
| void main() { | |
| gl_FragColor = texture2D( tex, vUv ); | |
| } |
| // FXAA 3.11 implementation by NVIDIA (github.com/NVIDIAGameWorks/GraphicsSamples) | |
| // Ported to WebGL by Agost Biro (github.com/abiro) | |
| //---------------------------------------------------------------------------------- | |
| // File: es3-kepler\FXAA\assets\shaders/FXAA_DefaultES.frag | |
| // SDK Version: v3.00 | |
| // Email: [email protected] | |
| // Site: http://developer.nvidia.com/ | |
| // | |
| // Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. |