Skip to content

Instantly share code, notes, and snippets.

View gamanox's full-sized avatar

Will Alvarez gamanox

  • Freelance
  • Saltillo, Coahuila, México
  • 01:23 (UTC -06:00)
View GitHub Profile
@mattdesl
mattdesl / about.md
Last active July 17, 2023 09:20
optimizing & de-duplicating geometry in GLTF files

optimize GLTF file

This optimizes a GLTF file that was exported by blender (or similar) by de-duplicating buffer views (i.e. chunks of bytes) that are equal and removing redundant accessors.

For example, 100 cubes of different scales/materials/rotations/etc should all end up using a single BufferGeometry in ThreeJS, which isn't the case with current GLTF exporters in Blender and parsers for ThreeJS.

In scenes with a lot of instancing, it can dramatically reduce total file size as well as render performance. In one test scene:

Before: 4.8MB file size, 832 THREE.Geometry instances across 832 THREE.Mesh objects
After: 661KB file size, 13 THREE.Geometry instances across 832 THREE.Mesh objects

@Jasonbit
Jasonbit / gist:73f9b82d8e129b94146f
Last active August 29, 2015 14:05
Yosemite freetype and ImageMagick error fixer
There's bummer errors on installing ImageMagick on Yosemite (as I write this, I'm on DP5). Here's the errors and fixes at the terminal.
Homer: jason$ brew reinstall --debug freetype
/usr/local/Library/brew.rb (Formulary::StandardLoader): loading /usr/local/Library/Formula/freetype.rb
==> Reinstalling freetype
/usr/local/Library/brew.rb (Formulary::StandardLoader): loading /usr/local/Library/Formula/libpng.rb
Warning: freetype-2.5.3_1 already installed
Homer: jason$ ln -s /usr/local/Cellar/freetype/2.5.2 /usr/local/Cellar/freetype/2.5.3_1
@matthewlehner
matthewlehner / autopgsqlbackup
Created July 11, 2012 16:10
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <[email protected]>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9