graphics-snippets

StackOverflow

“You should name a variable using the same care with which you name a first-born child.”
Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship


WebGL Examples

Hello Triangle

Hello Triangle - Node.js, WebGL 1.0
Hello Triangle - Node.js, WebGL 2.0

Geometry

Mesh

Displacement - vertex displacement on tessellated mesh

App

Rubiks cube

Tools

Light Model

Light Model - property transitions

Height Map Generator

Function Plotter

Normal and Parallax Mapping

No Mapping

Normal Mapping

Offset Limiting

Steep Parallax Mapping

Parallax Occlusion Mapping

Cone Step Mapping

Comparison of different “bump” mapping techniques

Ambient occlusion

SSAO (Screen Space Ambient Occlusion)

Special

Fire

Sketch

Sketch

StackOverflow examples

Shadow map

Simple fixed SSAO

SSAO - random noise and kernel

Simple blur - Blur cube

Blur sphere

Glow

Lambertian diffuse sphere

Lambertian diffuse fake light

Gouraud shading / Phong shading

Phong light model / Blinn Phong light model

Light cone

Clipping

Cube color

Textured cube

Parallax textured cube

Cube - glMatrix

Globe

Translation and rotation

Model View Projection

Unproject 2D - Screen coordinate to world

Unproject perspective - Intersect world by line of sight

Spherical projection

Load texture

Saturate texture

Cylindrical projected texture

Retro distortion

Blending

Texture flashlight

Toon silhouette

Voronoi

Voronoi triangles

Normal map 1

Background