float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input.mp4 -vf "fps=10,scale=720:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -y -i input_file.mp4 -c:v libx264 -c:a aac -strict experimental -tune fastdecode -pix_fmt yuv420p -b:a 192k -ar 48000 output_file.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script triangulates each .obj file in the input directory | |
# using Blender's Python API (https://docs.blender.org/api/current/index.html) | |
# It assumes that that the input/ and output/ directories exist | |
# Run with `blender --background --python triangulate.py` | |
# Tested with Blender 2.81 | |
# Note: Before running, make sure the default scene is empty by opening Blender, | |
# selecting and deleting everything (light, camera, & cube), | |
# and selecting File -> defaults -> Save startup file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function converts a Float16 stored as the bits of a Uint16 into a Javascript Number. | |
// Adapted from: https://gist.github.com/martinkallman/5049614 | |
// input is a Uint16 (eg, new Uint16Array([value])[0]) | |
function float16ToNumber(input) { | |
// Create a 32 bit DataView to store the input | |
const arr = new ArrayBuffer(4); | |
const dv = new DataView(arr); | |
// Set the Float16 into the last 16 bits of the dataview |