WebGL Shadow Maps Part 2: Lighting

In part one we got the basic technique working and created a shadow map. To keep part one as focused as possible, no other lighting calculations were done, leaving us with a shadow map but some weird self shadowing. Now we’re going to smooth our pixelated edges, add lighting calculations, clean up our code, and […]

WebGL Shadow Maps Part 1: As Simple as Possible

Shadow maps are surprisingly not too hard to implement in WebGL, at least not much harder than regular texturing, but you wouldn’t know that by looking for tutorials on them. The aim of this post is to fix that and provide a walkthrough from the simplest possible shadow map implementation to a reasonably nice final implementation. […]

The Making of Charon Jr. (JS13K Postmortem)

I came in 6th place! Thanks everyone that played and voted! This was my first ever 3D game, and really only the third game I’ve ever made. At the end of last year’s JS13K I knew I wanted to move to 3D, so I went on Kahn Academy and learned about vector math, matrix math, […]

Math for Game Development and WebGL Part 3: Radians

We’re getting into rotation now which means we are going to be doing a lot of math with angles. When doing math with angles, you generally won’t use degrees like you may be used to. In math you generally want to use radians. A radian measures the angle as related to the radius of the circle. […]

Math for Game Development and WebGL Part 1: Vectors

After rekindling my interest in 3D game development, I looked at WebGL. Being a web dev, this made sense. Unfortunately resources for this are mediocre at best. While WebGL2Fundamentals and the Introduction to Computer Graphics book do cover some of what’s needed, they largely skip the actual math and just tell you to do something. […]

Transforming Mouse Coordinates to Canvas Coordinates

Learn to transform the mouse cursor into transformed canvas coordinates, allowing you to drag, zoom to cursor, and interact with graphics in the canvas regardless of the canvas’s current transformation state. Extremely useful for html games and image editing programs. This post takes a modern approach to solving the problem using vanilla JavaScript, and explains the solution simply and in detail.