Through the looking glass - programming on the GPU using WebGL

Felix Palmer | @pheeelicks | www.pheelicks.com

Through the looking glass - programming on the GPU using WebGL


Felix Palmer | @pheeelicks | www.pheelicks.com

Slides: felixpalmer.github.io/tetris.gl/presentation.html

Code: github.com/felixpalmer/tetris.gl

Loading...

Overview



Slides: felixpalmer.github.io/tetris.gl/presentation.html

Loading...

WebGL basics

Getting a WebGL context

Define a quad

Shaders

Vertex shader

Fragment shader

Pipeline

WebGL basics - recap

Let's make something!

All interesting program state kept on CPU

JavaScript controls all state, WebGL just doing display

Render to Texture

Render to Texture

Why stop with a pipeline when we can have feedback loop?

Gives us state on the GPU!

Shaders

Building a (very) simple Tetris game

Process as pipeline

Drawing the ground

Spawning blocks

Spawning blocks at position

Shifting blocks along

Hit detection

Loading...

Oddities: GPUs != CPUs

Oddities: Branching

Oddities: Branching

Oddities: Lying loops

Oddities: Lying loops

Some examples

Loading...