[page:Material] →
[name]
A material for drawing geometries in a simple shaded (flat or wireframe) way.
The default will render as flat polygons. To draw the mesh as wireframe, simply set the 'wireframe' property to true.
Constructor
[name]( [page:Object parameters] )
parameters is an object with one or more properties defining the material's appearance.
color — geometry color in hexadecimal. Default is 0xffffff.
wireframe — render geometry as wireframe. Default is false.
wireframeLinewidth — Line thickness. Default is 1.
wireframeLinecap — Define appearance of line ends. Default is 'round'.
wireframeLinejoin — Define appearance of line joints. Default is 'round'.
shading — Define shading type. Default is THREE.SmoothShading.
vertexColors — Define how the vertices gets colored. Default is THREE.NoColors.
fog — Define whether the material color is affected by global fog settings. Default is true.
lightMap — Set light map. Default is null.
specularMap — Set specular map. Default is null.
alphaMap — Set alpha map. Default is null.
envMap — Set env map. Default is null.
skinning — Define whether the material uses skinning. Default is false.
morphTargets — Define whether the material uses morphTargets. Default is false.
Properties
.[page:Integer color]
Sets the color of the geometry. Default is 0xffffff.
.[page:Boolean wireframe]
Render geometry as wireframe. Default is false (i.e. render as flat polygons).
.[page:Float wireframeLinewidth]
Controls wireframe thickness. Default is 1.
Due to limitations in the
ANGLE layer, on Windows platforms linewidth will always be 1 regardless of the set value.
.[page:String wireframeLinecap]
Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.
.[page:String wireframeLinejoin]
Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.
.[page:Materials shading]
Define shading type. Default is THREE.SmoothShading. Possible values are THREE.NoShading, THREE.FlatShading, THREE.SmoothShading.
.[page:Materials vertexColors]
Define how the vertices gets colored. Possible values are THREE.NoColors, THREE.FaceColors and THREE.VertexColors. Default is THREE.NoColors.
This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.
.[page:Boolean fog]
Define whether the material color is affected by global fog settings.
This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.
.[page:Texture lightMap]
Set light map. Default is null.
.[page:Texture specularMap]
Set specular map. Default is null.
.[page:Texture alphaMap]
The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
.[page:TextureCube envMap]
Set env map. Default is null.
.[page:Boolean skinning]
Define whether the material uses skinning. Default is false.
.[page:Boolean morphTargets]
Define whether the material uses morphTargets. Default is false.
.[page:Texture map]
Sets the texture map. Default is null.
.[page:number combine]
How to combine the result of the surface's color with the environment map, if any.
.[page:number reflectivity]
How much the environment map affects the surface; also see "combine".
.[page:number refractionRatio]
The index of refraction for an environment map using [page:Textures THREE.CubeRefractionMapping]. Default is *0.98*.
Methods
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]