|
@@ -1,19 +1,19 @@
|
|
|
<!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"/>
|
|
|
+ <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>材质([name])</h1>
|
|
|
|
|
|
<p class="desc">材质的抽象基类。<br/><br/>
|
|
|
- 材质描述了对象[page:Object objects]的外观。它们的定义方式与渲染器无关,
|
|
|
- 因此,如果您决定使用不同的渲染器,不必重写材质。<br/><br/>
|
|
|
- 所有其他材质类型都继承了以下属性和方法(尽管它们可能具有不同的默认值)。
|
|
|
+ 材质描述了对象[page:Object objects]的外观。它们的定义方式与渲染器无关,
|
|
|
+ 因此,如果您决定使用不同的渲染器,不必重写材质。<br/><br/>
|
|
|
+ 所有其他材质类型都继承了以下属性和方法(尽管它们可能具有不同的默认值)。
|
|
|
</p>
|
|
|
|
|
|
<h2>构造函数(Constructor)</h2>
|
|
@@ -31,8 +31,8 @@
|
|
|
|
|
|
<h3>[property:Integer blendDst]</h3>
|
|
|
<p> 混合目标。默认值为[page:CustomBlendingEquation OneMinusSrcAlphaFactor]。
|
|
|
- 目标因子所有可能的取值请参阅[page:CustomBlendingEquation constants]。
|
|
|
- 必须将材质的[page:Constant blending]设置为[page:Materials CustomBlending]才能生效。<br/>
|
|
|
+ 目标因子所有可能的取值请参阅[page:CustomBlendingEquation constants]。
|
|
|
+ 必须将材质的[page:Constant blending]设置为[page:Materials CustomBlending]才能生效。<br/>
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Integer blendDstAlpha]</h3>
|
|
@@ -40,8 +40,8 @@
|
|
|
|
|
|
<h3>[property:Integer blendEquation]</h3>
|
|
|
<p> 使用混合时所采用的混合方程式。默认值为[page:CustomBlendingEquation AddEquation]。
|
|
|
- 混合方程式所有可能的取值请参阅[page:CustomBlendingEquation constants]。
|
|
|
- 必须将材质的[page:Constant blending]设置为[page:Materials CustomBlending]才能生效。<br/>
|
|
|
+ 混合方程式所有可能的取值请参阅[page:CustomBlendingEquation constants]。
|
|
|
+ 必须将材质的[page:Constant blending]设置为[page:Materials CustomBlending]才能生效。<br/>
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Integer blendEquationAlpha]</h3>
|
|
@@ -49,15 +49,15 @@
|
|
|
|
|
|
<h3>[property:Blending blending]</h3>
|
|
|
<p> 在使用此材质显示对象时要使用何种混合。<br/>
|
|
|
- 必须将其设置为[page:Materials CustomBlending]才能使用自定义[page:Constant blendSrc], [page:Constant blendDst] 或者 [page:Constant
|
|
|
- blendEquation]。
|
|
|
- 混合模式所有可能的取值请参阅[page:Materials constants]。默认值为[page:Materials NormalBlending]。
|
|
|
+ 必须将其设置为[page:Materials CustomBlending]才能使用自定义[page:Constant blendSrc], [page:Constant blendDst] 或者 [page:Constant
|
|
|
+ blendEquation]。
|
|
|
+ 混合模式所有可能的取值请参阅[page:Materials constants]。默认值为[page:Materials NormalBlending]。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Integer blendSrc]</h3>
|
|
|
<p> 混合源。默认值为[page:CustomBlendingEquation SrcAlphaFactor]。
|
|
|
- 源因子所有可能的取值请参阅[page:CustomBlendingEquation constants]。<br/>
|
|
|
- 必须将材质的[page:Constant blending]设置为[page:Materials CustomBlending]才能生效。
|
|
|
+ 源因子所有可能的取值请参阅[page:CustomBlendingEquation constants]。<br/>
|
|
|
+ 必须将材质的[page:Constant blending]设置为[page:Materials CustomBlending]才能生效。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Integer blendSrcAlpha]</h3>
|
|
@@ -69,9 +69,9 @@
|
|
|
|
|
|
<h3>[property:Array clippingPlanes]</h3>
|
|
|
<p>
|
|
|
- 用户定义的剪裁平面,在世界空间中指定为THREE.Plane对象。这些平面适用于所有使用此材质的对象。空间中与平面的有符号距离为负的点被剪裁(未渲染)。
|
|
|
- 这需要[page:WebGLRenderer.localClippingEnabled]为*true*。
|
|
|
- 示例请参阅[example:webgl_clipping_intersection WebGL / clipping /intersection]。默认值为 *null*。
|
|
|
+ 用户定义的剪裁平面,在世界空间中指定为THREE.Plane对象。这些平面适用于所有使用此材质的对象。空间中与平面的有符号距离为负的点被剪裁(未渲染)。
|
|
|
+ 这需要[page:WebGLRenderer.localClippingEnabled]为*true*。
|
|
|
+ 示例请参阅[example:webgl_clipping_intersection WebGL / clipping /intersection]。默认值为 *null*。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean clipShadows]</h3>
|
|
@@ -80,17 +80,17 @@
|
|
|
|
|
|
<h3>[property:Boolean colorWrite]</h3>
|
|
|
<p> 是否渲染材质的颜色。
|
|
|
- 这可以与网格的[page:Integer renderOrder]属性结合使用,以创建遮挡其他对象的不可见对象。默认值为*true*。
|
|
|
+ 这可以与网格的[page:Integer renderOrder]属性结合使用,以创建遮挡其他对象的不可见对象。默认值为*true*。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Object defines]</h3>
|
|
|
<p> 注入shader的自定义对象。 以键值对形式的对象传递,{ MY_CUSTOM_DEFINE: '' , PI2: Math.PI * 2 }。
|
|
|
- 这些键值对在顶点和片元着色器中定义。默认值为*undefined*。
|
|
|
+ 这些键值对在顶点和片元着色器中定义。默认值为*undefined*。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Integer depthFunc]</h3>
|
|
|
<p> 使用何种深度函数。默认为[page:Materials LessEqualDepth]。
|
|
|
- 深度模式所有可能的取值请查阅[page:Materials constants]。
|
|
|
+ 深度模式所有可能的取值请查阅[page:Materials constants]。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean depthTest]</h3>
|
|
@@ -99,7 +99,7 @@
|
|
|
|
|
|
<h3>[property:Boolean depthWrite]</h3>
|
|
|
<p>渲染此材质是否对深度缓冲区有任何影响。默认为*true*。<br/><br/>
|
|
|
- 在绘制2D叠加时,将多个事物分层在一起而不创建z-index时,禁用深度写入会很有用。
|
|
|
+ 在绘制2D叠加时,将多个事物分层在一起而不创建z-index时,禁用深度写入会很有用。
|
|
|
</p>
|
|
|
|
|
|
|
|
@@ -156,7 +156,7 @@ Which stencil operation to perform when the comparison function returns true and
|
|
|
<h3>[property:Boolean isMaterial]</h3>
|
|
|
<p>用于检查此类或派生类是否为材质。默认值为 *true*。<br/><br/>
|
|
|
|
|
|
- 因为其通常用在内部优化,所以不应该更改该属性值。
|
|
|
+ 因为其通常用在内部优化,所以不应该更改该属性值。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:String name]</h3>
|
|
@@ -164,13 +164,13 @@ Which stencil operation to perform when the comparison function returns true and
|
|
|
|
|
|
<h3>[property:Boolean needsUpdate]</h3>
|
|
|
<p>指定需要重新编译材质。<br/>
|
|
|
- 实例化新材质时,此属性自动设置为true。
|
|
|
+ 实例化新材质时,此属性自动设置为true。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Float opacity]</h3>
|
|
|
<p> 在0.0 - 1.0的范围内的浮点数,表明材质的透明度。值*0.0*表示完全透明,*1.0*表示完全不透明。<br/>
|
|
|
- 如果材质的[page:Boolean transparent]属性未设置为*true*,则材质将保持完全不透明,此值仅影响其颜色。
|
|
|
- 默认值为*1.0*。 <br/>
|
|
|
+ 如果材质的[page:Boolean transparent]属性未设置为*true*,则材质将保持完全不透明,此值仅影响其颜色。
|
|
|
+ 默认值为*1.0*。 <br/>
|
|
|
|
|
|
</p>
|
|
|
|
|
@@ -190,7 +190,7 @@ Which stencil operation to perform when the comparison function returns true and
|
|
|
|
|
|
<h3>[property:Boolean premultipliedAlpha]</h3>
|
|
|
<p> 是否预乘alpha(透明度)值。有关差异的示例,请参阅[Example:webgl_materials_transparency WebGL / Materials / Transparency]。
|
|
|
- 默认值为*false*。
|
|
|
+ 默认值为*false*。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean dithering]</h3>
|
|
@@ -199,31 +199,31 @@ Which stencil operation to perform when the comparison function returns true and
|
|
|
|
|
|
<h3>[property:Integer shadowSide]</h3>
|
|
|
<p> 定义投影的面。设置时,可以是[page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], 或[page:Materials]。默认值为 *null*。
|
|
|
- <br/>
|
|
|
- 如果为*null*, 则面投射阴影确定如下: <br/>
|
|
|
+ <br/>
|
|
|
+ 如果为*null*, 则面投射阴影确定如下: <br/>
|
|
|
|
|
|
<table>
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>[page:Material.side]</th>
|
|
|
- <th>Side casting shadows</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
-
|
|
|
- <tr>
|
|
|
- <td>THREE.FrontSide</td>
|
|
|
- <td>背面</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>THREE.BackSide</td>
|
|
|
- <td>前面</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>THREE.DoubleSide</td>
|
|
|
- <td>双面</td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>[page:Material.side]</th>
|
|
|
+ <th>Side casting shadows</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td>THREE.FrontSide</td>
|
|
|
+ <td>背面</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>THREE.BackSide</td>
|
|
|
+ <td>前面</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>THREE.DoubleSide</td>
|
|
|
+ <td>双面</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
@@ -231,7 +231,7 @@ Which stencil operation to perform when the comparison function returns true and
|
|
|
|
|
|
<h3>[property:Integer side]</h3>
|
|
|
<p> 定义将要渲染哪一面 - 正面,背面或两者。
|
|
|
- 默认为[page:Materials THREE.FrontSide]。其他选项有[page:Materials THREE.BackSide]和[page:Materials THREE.DoubleSide]。
|
|
|
+ 默认为[page:Materials THREE.FrontSide]。其他选项有[page:Materials THREE.BackSide]和[page:Materials THREE.DoubleSide]。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean toneMapped]</h3>
|
|
@@ -241,10 +241,10 @@ Defines whether this material is tone mapped according to the renderer's [page:W
|
|
|
|
|
|
<h3>[property:Boolean transparent]</h3>
|
|
|
<p>
|
|
|
- 定义此材质是否透明。这对渲染有影响,因为透明对象需要特殊处理,并在非透明对象之后渲染。
|
|
|
- <br/>
|
|
|
- 设置为true时,通过设置材质的[page:Float opacity]属性来控制材质透明的程度。<br/>
|
|
|
- 默认值为*false*。
|
|
|
+ 定义此材质是否透明。这对渲染有影响,因为透明对象需要特殊处理,并在非透明对象之后渲染。
|
|
|
+ <br/>
|
|
|
+ 设置为true时,通过设置材质的[page:Float opacity]属性来控制材质透明的程度。<br/>
|
|
|
+ 默认值为*false*。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:String type]</h3>
|
|
@@ -257,13 +257,13 @@ Defines whether this material is tone mapped according to the renderer's [page:W
|
|
|
|
|
|
<h3>[property:Integer vertexColors]</h3>
|
|
|
<p> 是否使用顶点着色。默认值为[page:Materials THREE.NoColors]。
|
|
|
- 其他选项有[page:Materials THREE.VertexColors] 和 [page:Materials THREE.FaceColors]。
|
|
|
+ 其他选项有[page:Materials THREE.VertexColors] 和 [page:Materials THREE.FaceColors]。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean vertexTangents]</h3>
|
|
|
<p> Defines whether precomputed vertex tangents, which must be provided in a vec4 "tangent" attribute,
|
|
|
- are used. When disabled, tangents are derived automatically. Using precomputed tangents will give
|
|
|
- more accurate normal map details in some cases, such as with mirrored UVs. Default is false.
|
|
|
+ are used. When disabled, tangents are derived automatically. Using precomputed tangents will give
|
|
|
+ more accurate normal map details in some cases, such as with mirrored UVs. Default is false.
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean visible]</h3>
|
|
@@ -297,13 +297,13 @@ Unlike properties, the callback is not supported by [page:Material.clone .clone]
|
|
|
|
|
|
<h3>[method:null setValues]( [param:object values] )</h3>
|
|
|
<p> values -- 具有参数的容器。
|
|
|
- 根据*values*设置属性。<br/>
|
|
|
+ 根据*values*设置属性。<br/>
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Object toJSON]( [param:object meta] )</h3>
|
|
|
<p>
|
|
|
- meta -- 包含有元数据的对象,例如该对象的纹理或图片。
|
|
|
- 将material对象转换为 three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format](three.js JSON 物体/场景格式)。
|
|
|
+ meta -- 包含有元数据的对象,例如该对象的纹理或图片。
|
|
|
+ 将material对象转换为 three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format](three.js JSON 物体/场景格式)。
|
|
|
</p>
|
|
|
|
|
|
<h2>源码(Source)</h2>
|