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
// Usage: | |
// var txt = alignPlane(createText2D('String', 'red', 'Verdana', 64), THREE.RightAlign, THREE.BottomAlign); | |
// scene.addChild(txt); | |
function createTextCanvas(text, color, font, size) { | |
size = size || 24; | |
var canvas = document.createElement('canvas'); | |
var ctx = canvas.getContext('2d'); | |
var fontStr = (font || 'Arial') + ' ' + (size +'px'); | |
ctx.font = fontStr; |
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
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n |
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
// THREEjs build-in uniforms and attributes (Fragment) | |
// uniform mat4 viewMatrix - camera.matrixWorldInverse | |
// uniform vec3 cameraPosition - camera position in world space | |
varying vec2 vUv; | |
uniform sampler2D albedo; | |
void main() { |