Skip to content

Instantly share code, notes, and snippets.

attribute float direction;
attribute vec2 distances;
attribute float vertexThickness;
attribute vec3 nextPosition;
attribute vec3 previousPosition;
varying vec2 vUv;
const bool miter = false;
const float miterLimit = 8.0;
@i5anoff
i5anoff / VtxAniExport.ms
Created February 6, 2020 06:47 — forked from silvesthu/VtxAniExport.ms
Vertex Animation Export Maxscript
macroScript VtxAniExport
category: "VertexAnimation"
-- Export texture and a set of parameters to enable vertex animation
-- Reference: https://github.com/apras/Unity-VertexTextureFetchAnimation/blob/master/Assets/Model/VTF.ms
-- Reference: https://docs.unrealengine.com/latest/INT/Engine/Animation/Tools/VertexAnimationTool/
(
rollout _rollout "Vertex Animation Export"
(
label objectName "Object" align:#center
@i5anoff
i5anoff / kotaku_hzd.md
Created January 29, 2020 11:33 — forked from nothings/kotaku_hzd.md
Why Frustum Culling Matters, and Why It's Not Important

There is a nice GIF illustrating a technique called "frustum culling" in this Kotaku article: http://kotaku.com/horizon-zero-dawn-uses-all-sorts-of-clever-tricks-to-lo-1794385026

The interwebs being what they are, this has also led to some controversy.

Some people have interpreted the opening sentence "Every time you move the camera in Horizon Zero Dawn, the game is doing all sorts of under-the-hood calculations, loading and unloading chunks of world to ensure that it all runs properly," as being about the GIF; that's not what frustum culling does, but that's probably not what the article's author meant anyway.

@i5anoff
i5anoff / how_to_revert_git_repo_to_prev_commit.md
Created January 12, 2020 06:14
How to revert Git repository to a previous commit

Temporarily switch to a different commit

If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit:

# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32
@i5anoff
i5anoff / mpv-gif.lua
Created December 31, 2019 20:09 — forked from Ruin0x11/mpv-gif.lua
Create animated GIFs using mpv
-- Create animated GIFs with mpv
-- Requires ffmpeg.
-- Adapted from http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
-- Usage: "g" to set start frame, "G" to set end frame, "Ctrl+g" to create.
local msg = require 'mp.msg'
-- Set this to the filters to pass into ffmpeg's -vf option.
-- filters="fps=24,scale=320:-1:flags=lanczos"
filters="fps=15,scale=540:-1:flags=lanczos"

I’m looking forward to the Sass Fundamentals workshop! A few notes to ensure you’re set up in advance are below.

See you soon!

Mike

Node.js

You’ll need a relatively recent version (v4.5 or newer, v7 ideally) of node.js installed. On OS X, a great way of doing this without disturbing your existing dev environment is to install NVM. Installation instructions are here.

// Remember to bring in three.js and here is the script for the trackball controls as well:
// https://cdn.rawgit.com/mrdoob/three.js/dev/examples/js/controls/TrackballControls.js
//RENDERER
const renderer = new THREE.WebGLRenderer({
canvas: document.getElementById('canvas'),
antialias: true
});
renderer.setClearColor(0x25c8ce);
renderer.setPixelRatio(window.devicePixelRatio);
@i5anoff
i5anoff / FOO2GLTF.js
Created December 4, 2019 18:27 — forked from donmccurdy/FOO2GLTF.js
Example Node.js glTF conversion script, using three.js.
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const THREE = require('three');
const program = require('commander');
const Canvas = require('canvas');
const { Blob, FileReader } = require('vblob');
// Patch global scope to imitate browser environment.
@i5anoff
i5anoff / about.md
Created December 3, 2019 09:03 — forked from mattdesl/about.md

procedural mesh generation

Generates an algorithmic 3D OBJ file with ThreeJS and Node.js.

# print to stdout
node generate-mesh.js > test.obj

# write to file
node generate-mesh.js test.obj
@i5anoff
i5anoff / about.md
Created November 5, 2019 02:09 — forked from mattdesl/about.md

high res tiled rendering with canvas-sketch

Copy these files in the gist to a new folder. Generate a package.json:

cd folder-with-code
npm init -y

Then install deps: