Three.js Loading Models
In my post on Geometry in Three.js I discussed the different types of primitives we have available. Primitives are a powerful tool but creating 3D objects with only primitives and code can only get you so far. For full control over your 3D models it is best to use a 3D modeling application and then import your models into Three.js.Read more...
Three.js Post Processing
Post-Processing is the addition of image effects or filters to your entire scene. This can change the feel of your scene and simulate interesting visual effects. Some examples are applying a sepia tone, or adding static the scene, giving it the feel of older television sets. To achieve this in Three.js we utilize shaders. The process involves creating an
EffectComposer and then chaining together effects by adding passes to it. Passes are how we define the sequence of rendering and effects in the composer. There are different kinds of passes that achieve different results. I should also note that the classes and files used such as
EffectComposer and the built in passes are not technically part of Three.js, but can be found in the examples included with the library.
Three.js Lights and Cameras
Lights can really make the difference between a seemingly flat scene and a visual masterpiece. Think of any photo-realistic painting or photograph and then imagine it with poor lighting and the impact is just not the same. Cameras change the way we view our scenes altogether, think of the different types of lenses photographers use and how they can influence the perspective and depth of a photo. Lights do not work on all materials. Lights do work with
Three.js Custom Materials with ShaderMaterial
Three.js comes with many materials built in. All these materials drawn in WebGL utilize shaders. Shaders are small programs that run on the GPU written in GLSL. We can create our own custom materials in Three.js by writing our own shaders and passing them into a
ShaderMaterial, which we can then use in our scene.
Materials determine how the surface of our geometry is drawn in Three.js. If the Geometry is our skeleton, defining the shape, then the Material is our skin. There are a variety of different types of materials in Three.js all of which have different properties, like responding to lights, mapping textures, and adjusting opacity.Read more...
Geometry defines the shape of the objects we draw in Three.js. Geometry is made up of a collection of vertices and often faces which combine three vertices into a triangle face. You can create your own custom geometry by defining these vertices and faces yourself, but Three.js also has a variety of common shapes for you to access and set properties of built in.Read more...
Scripting SVG in Animate CC
Masking in GLSL
WebGL is complicated. Libraries like Three.js have made it more approachable but to do advanced effects you still need to understand the inner workings of WebGL, this includes GLSL shaders. Shaders are small programs that run on the GPU and they consist of two types, vertex shaders which draw the geometry and fragment shaders which draw the colors to present the final output.Read more...