File: Materials.html

package info (click to toggle)
three.js 111%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 15,184 kB
  • sloc: javascript: 133,174; makefile: 24; sh: 1
file content (148 lines) | stat: -rw-r--r-- 6,623 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<base href="../../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		<h1>Material Constants</h1>

		<p class="desc">
		These constants define properties common to all material types,
		with the exception of Texture Combine Operations which only apply to [page:MeshBasicMaterial.combine MeshBasicMaterial], [page:MeshLambertMaterial.combine MeshLambertMaterial] and [page:MeshPhongMaterial.combine MeshPhongMaterial].<br />
		</p>


		<h2>Side</h2>
		<code>
		THREE.FrontSide
		THREE.BackSide
		THREE.DoubleSide
		</code>
		<p>
		Defines which side of faces will be rendered - front, back or both.
		Default is [page:Constant FrontSide].
		</p>


		<h2>Colors</h2>
		<code>
		THREE.NoColors
		THREE.FaceColors
		THREE.VertexColors
		</code>
		<p>
		[page:Constant NoColors] is the default and applies the material's color to all faces.<br />
		[page:Constant FaceColors] colors faces according to each [page:Face3 Face3] [page:Color Color] value.<br />
		[page:Constant VertexColors] colors faces according to each [page:Face3 Face3] vertexColors value. This is an array of three [page:Color Color]s, one for each vertex in the face.<br />
		See the [example:webgl_geometry_colors geometry / colors] example.
		</p>

		<h2>Blending Mode</h2>
		<code>
		THREE.NoBlending
		THREE.NormalBlending
		THREE.AdditiveBlending
		THREE.SubtractiveBlending
		THREE.MultiplyBlending
		THREE.CustomBlending
		</code>


		<p>
		These control the source and destination blending equations for the material's RGB and Alpha sent to the WebGLRenderer for use by WebGL.<br />
		[page:Constant NormalBlending] is the default.<br />
		Note that [page:Constant CustomBlending] must be set to use [page:CustomBlendingEquation Custom Blending Equations].<br />
		See the [example:webgl_materials_blending materials / blending] example.<br />
		</p>

		<h2>Depth Mode</h2>
		<code>
		THREE.NeverDepth
		THREE.AlwaysDepth
		THREE.LessDepth
		THREE.LessEqualDepth
		THREE.GreaterEqualDepth
		THREE.GreaterDepth
		THREE.NotEqualDepth
		</code>
		<p>
		Which depth function the material uses to compare incoming pixels Z-depth against the current Z-depth buffer value. If the result of the comparison is true, the pixel will be drawn.<br />
		[page:Materials NeverDepth] will never return true.<br />
		[page:Materials AlwaysDepth] will always return true.<br />
		[page:Materials LessDepth] will return true if the incoming pixel Z-depth is less than the current buffer Z-depth.<br />
		[page:Materials LessEqualDepth] is the default and will return true if the incoming pixel Z-depth is less than or equal to the current buffer Z-depth.<br />
		[page:Materials GreaterEqualDepth] will return true if the incoming pixel Z-depth is greater than or equal to the current buffer Z-depth.<br />
		[page:Materials GreaterDepth] will return true if the incoming pixel Z-depth is greater than the current buffer Z-depth.<br />
		[page:Materials NotEqualDepth] will return true if the incoming pixel Z-depth is not equal to the current buffer Z-depth.<br />
		</p>

		<h2>Texture Combine Operations</h2>
		<code>
		THREE.MultiplyOperation
		THREE.MixOperation
		THREE.AddOperation
		</code>
		<p>
		These define how the result of the surface's color is combined with the environment map (if present), for [page:MeshBasicMaterial.combine MeshBasicMaterial], [page:MeshLambertMaterial.combine MeshLambertMaterial] and [page:MeshPhongMaterial.combine MeshPhongMaterial]. <br />
		[page:Constant MultiplyOperation] is the default and multiplies the environment map color with the surface color.<br />
		[page:Constant MixOperation] uses reflectivity to blend between the two colors.<br />
		[page:Constant AddOperation] adds the two colors.
		</p>

		<h2>Stencil Functions</h2>
		<code>
		THREE.NeverStencilFunc
		THREE.LessStencilFunc
		THREE.EqualStencilFunc
		THREE.LessEqualStencilFunc
		THREE.GreaterStencilFunc
		THREE.NotEqualStencilFunc
		THREE.GreaterEqualStencilFunc
		THREE.AlwaysStencilFunc
		</code>
		<p>
		Which stencil function the material uses to determine whether or not to perform a stencil operation.<br />
		[page:Materials NeverStencilFunc] will never return true.<br />
		[page:Materials LessStencilFunc] will return true if the stencil reference value is less than the current stencil value.<br />
		[page:Materials EqualStencilFunc] will return true if the stencil reference value is equal to the current stencil value.<br />
		[page:Materials LessEqualStencilFunc] will return true if the stencil reference value is less than or equal to the current stencil value.<br />
		[page:Materials GreaterStencilFunc] will return true if the stencil reference value is greater than the current stencil value.<br />
		[page:Materials NotEqualStencilFunc] will return true if the stencil reference value is not equal to the current stencil value.<br />
		[page:Materials GreaterEqualStencilFunc] will return true if the stencil reference value is greater than or equal to the current stencil value.<br />
		[page:Materials AlwaysStencilFunc] will always return true.<br />
		</p>

		<h2>Stencil Operations</h2>
		<code>
		THREE.ZeroStencilOp
		THREE.KeepStencilOp
		THREE.ReplaceStencilOp
		THREE.IncrementStencilOp
		THREE.DecrementStencilOp
		THREE.IncrementWrapStencilOp
		THREE.DecrementWrapStencilOp
		THREE.InvertStencilOp
		</code>
		<p>
		Which stencil operation the material will perform on the stencil buffer pixel if the provided stencil function passes.<br />
		[page:Materials ZeroStencilOp] will set the stencil value to 0.<br />
		[page:Materials KeepStencilOp] will not change the current stencil value.<br />
		[page:Materials ReplaceStencilOp] will replace the stencil value with the specified stencil reference value.<br />
		[page:Materials IncrementStencilOp] will increment the current stencil value by 1.<br />
		[page:Materials DecrementStencilOp] will decrement the current stencil value by 1.<br />
		[page:Materials IncrementWrapStencilOp] will increment the current stencil value by 1. If the value increments past 255 it will be set to 0.<br />
		[page:Materials DecrementWrapStencilOp] will increment the current stencil value by 1. If the value decrements below 0 it will be set to 255.<br />
		[page:Materials InvertStencilOp] will perform a bitwise iversion of the current stencil value.<br />
		</p>

		<h2>Source</h2>

		<p>
			[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
		</p>
	</body>
</html>