Skip to content

Instantly share code, notes, and snippets.

View shengsword's full-sized avatar
🤒
Out sick

shengsword

🤒
Out sick
View GitHub Profile
@shengsword
shengsword / instructions.md
Created December 14, 2020 16:54 — forked from Bjvanminnen/instructions.md
How to use glslify with create-react-app

Create your app

create-react-app my-app
cd my-app

Eject it, so that we can modify webpack config

npm run eject
y # when prompted
@shengsword
shengsword / GLSL-Noise.md
Created March 1, 2020 16:30 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@shengsword
shengsword / billboard_sao.frag
Created August 28, 2019 04:23 — forked from transitive-bullshit/billboard_sao.frag
WebGL GLSL SAO (Scalable Ambient Obscurance) fragment shader. SAO is a more efficient method for computing SSAO (Screen-Space Ambient Occlusion). Converts the g-buffer to an occlusion buffer which estimates local ambient occlusion at each fragment in screen-space. For details on the technique itself, see: McGuire et al [12] http://graphics.cs.wi…
// total number of samples at each fragment
#define NUM_SAMPLES {{ numSamples }}
#define NUM_SPIRAL_TURNS {{ numSpiralTurns }}
#define USE_ACTUAL_NORMALS {{ useActualNormals }}
#define VARIATION {{ variation }}
uniform sampler2D sGBuffer;