Skip to content

Instantly share code, notes, and snippets.

View siemiatj's full-sized avatar

Kuba Siemiątkowski siemiatj

View GitHub Profile
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@veeneck
veeneck / shader6.fsh
Created May 28, 2015 17:58
Shadertoy: Glowing
// https://www.shadertoy.com/view/4lB3DG
void main() {
vec4 val = texture2D(u_texture, v_tex_coord);
vec4 grad = texture2D(u_gradient, v_tex_coord);
if (val.a < 0.1 && grad.r < 0.65 && grad.a > 0.73) {
vec2 u = gl_FragCoord.xy / u_sprite_size.xy,
c = vec2(.5) - u;
float t = u_time,
@densmoe
densmoe / GameScene.swift
Last active January 23, 2017 04:45
[Swift/SpriteKit] Game demo with multiple touch panning gestures
//http://stackoverflow.com/questions/31928324/how-to-drag-a-skspritenode-without-touching-it-with-swift/31930669?noredirect=1#comment51852474_31930669
import SpriteKit
class GameScene: SKScene {
var leftShape:ConfinedShape!
var rightShape:ConfinedShape!
override func didMoveToView(view: SKView) {