Rendering large terrains

Today we’ll look at how to efficiently render a large terrain in 3D. We’ll be using WebGL to do this, but the techniques can be applied pretty much anywhere. We’ll concentrate on the vertex shader, that is, how best to use the position the vertices of our terrain mesh, so that it looks good up […]

WebGL tombstone – bump mapping

This post is part of a series on how to deform a 3D mesh (in this case, a tombstone) by drawing onto a 2D Canvas. To start from the beginning, click here. In the previous post we looked at how to calculate the lighting for our tombstone in the fragment shader. While a vast improvement […]

WebGL Tombstone – lighting model

In the previous post we looked at how to deform a 3D mesh by using a depth map drawn onto a 2D canvas. In particular, we’d draw a pattern onto a canvas and have that pattern “carved” out of a slab of rock. There’s a live demo here, if you haven’t seen it already. Last […]

WebGL Tombstone – part 2

In the previous post we looked at how to link up a 2D HTML canvas with an object in a 3D scene, so that when we drew on the canvas, the drawing would appear on the surface of an object in the 3D world. Specifically, we were painting onto a tombstone. Today, we’ll look at […]

WebGL Tombstone – part 1

Recently, I’ve been combining 2D Canvas objects with WebGL Canvas objects, and figured it would be nice to put together a demo with some of the techniques used. An obvious application for these techniques is an in-browser tombstone designer, that’ll let us take a nice slab of rock and draw and carve all over it. […]

Intro to (images in) Go – UI

This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. A few posts back, we looked at how to set up a simple HTTP server and also how to communicate with a web page using WebSockets. Today we’ll combine this with […]

Intro to (images in) Go – websockets

This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. In the last post we looked at how to set up a HTTP server, to serve up an API or static files. Today we’ll do something more real-time, namely using WebSockets […]

Intro to (images in) Go – http

This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. So far, we’ve pretty much always been using Go to spit out static image files. However, it’d be nice if we could do something a little bit more interactive, like generate […]

Intro to (images in) Go – concurrency

This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. Turns out that despite all the shilly-shallying in the previous posts, we didn’t talk about one of Go’s most useful features, built-in concurrency implemented using go-routines and channels. Today seems like […]

Intro to (images in) Go – filters

This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. Recently I came across a most agreeable app, Instagram, that lets you add filters and what-not to your photos, and I thought it would be remiss not to try something similar […]