The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Apply varying colors per-vertex to WebGL triangles

Apply varying colors per-vertex to WebGL triangles

4:55
In this lesson we will apply a single color per vertex and see how those colors are interpolated across an entire triangle, making use of a new kind of shader variable. We will also see how enabling `gl.DEPTH_TEST` will give our model proper depth by having webGL pay attention to z-values. **Note:** This lesson assumes prior knowledge in WebGL. Check out [Create 3D Graphics in JavaScript Using WebGL](https://egghead.io/courses/create-3d-graphics-in-javascript-using-webgl) for an in depth introduction to WebGL if some of these concepts are feeling unfamiliar.
Watch this lesson now
Avatar
egghead.io

In this lesson we will apply a single color per vertex and see how those colors are interpolated across an entire triangle, making use of a new kind of shader variable. We will also see how enabling gl.DEPTH_TEST will give our model proper depth by having webGL pay attention to z-values.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?