In three.js The basic material seems to come up a lot, for example it is the default material that is used when creating a Mesh if a material is not specified. Also it is still a decent material if you want to just skin a mesh with a texture and do not want to do anything special involving reflection of light. So today I thought I would continue expanding my collection of posts on three.js by writing a post on the basic material, and what it has to offer when making a three.js project.
This is a post on the basic material used in three.js. If you are new to three.js, you might want to start with my getting started post on three.js. You might also want ot check out my post on three.js materials in general as well.
The Basic material is the default material used for a mesh so if I just directly add a Mesh to a scene without giving a material, the mesh will used the basic material with a random color.
Typically I will want to use the MeshBasicMaterial constructor to create an instance of basic material thought if I want to set at least one property of the material.
I have written a post on using canvas as a texture in which I covered this in further detail, but the basic idea is there.
The basic material is just as the name suggests, there are other materials to use in three.js if you want to do something more advanced. There is of course the Lambert material that is a good choice if you want to do something involving light in a real time environment. There are of course many other materials to chose from when working with a mesh as well.
There are many other properties in the basic material that I have not covered here, but some of them seem like they might be worthy of a whole new post such as with the ambient occlusion map texture that can be used.