Skip to content

Instantly share code, notes, and snippets.

View momo-the-monster's full-sized avatar

Momo the Monster momo-the-monster

View GitHub Profile
@momo-the-monster
momo-the-monster / threejsatlasloader.js
Last active May 5, 2022 14:51
Three.JS Atlas Loader
// json is a JSON atlas generated by TexturePacker
// imagepath is a url to the full texture atlas image
var atlasTexture = THREE.ImageUtils.loadTexture( imagepath, undefined, function() {
for (var key in json.frames) {
var tex = atlasTexture.clone();
var frame = json.frames[key].frame;
tex.repeat.x = ( frame.w / atlasTexture.image.width );
@momo-the-monster
momo-the-monster / GPUMirror.frag
Created August 10, 2012 20:58
Mirroring Frag Shader
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform highp float division;
uniform int mode;
void main()
{
if(mode == 0) {
// Bypass
gl_FragColor = texture2D(inputImageTexture, textureCoordinate);