|
@@ -12,12 +12,11 @@
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
<p class="desc">
|
|
|
- This is used internally by [page:PointLight PointLights] for calculating shadows, and also serves as
|
|
|
- a base class for the other shadow classes.
|
|
|
+ 这在 [page:PointLight PointLights] 内部用于计算阴影,也可用作其他阴影类的基类。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
- <h2>Example</h2>
|
|
|
+ <h2>例子</h2>
|
|
|
<p>
|
|
|
<code>
|
|
|
//Create a WebGLRenderer and turn on shadows in the renderer
|
|
@@ -58,83 +57,78 @@ scene.add( helper );
|
|
|
</code>
|
|
|
</p>
|
|
|
|
|
|
- <h2>Constructor</h2>
|
|
|
+ <h2>构造函数</h2>
|
|
|
|
|
|
<h3>[name]( [param:Camera camera] )</h3>
|
|
|
<p>
|
|
|
- [page:Camera camera] - the light's view of the world.<br /><br />
|
|
|
+ [page:Camera camera] - 在光的世界里<br /><br />
|
|
|
|
|
|
- Create a new [name]. This is not intended to be called directly - it is called
|
|
|
- internally by [page:PointLight] or used as a base class by other light shadows.
|
|
|
+ 创建一个新的[name]。这不能直接调用的 - 它由[page:PointLight]在内部调用,或者由其他阴影用作基类。
|
|
|
</p>
|
|
|
|
|
|
- <h2>Properties</h2>
|
|
|
+ <h2>属性</h2>
|
|
|
|
|
|
<h3>[property:Camera camera]</h3>
|
|
|
<p>
|
|
|
- The light's view of the world. This is used to generate a depth map of the scene; objects behind
|
|
|
- other objects from the light's perspective will be in shadow.
|
|
|
+ 光的世界里。这用于生成场景的深度图;从光的角度来看,其他物体背后的物体将处于阴影中。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Float bias]</h3>
|
|
|
<p>
|
|
|
- Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.<br />
|
|
|
- The default is 0. Very tiny adjustments here (in the order of 0.0001) may help reduce artefacts in shadows
|
|
|
+ 阴影贴图偏差,在确定曲面是否在阴影中时,从标准化深度添加或减去多少。<br />
|
|
|
+ 默认值为0.此处非常小的调整(大约0.0001)可能有助于减少阴影中的伪影
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:WebGLRenderTarget map]</h3>
|
|
|
<p>
|
|
|
- The depth map generated using the internal camera; a location beyond a pixel's depth is
|
|
|
- in shadow. Computed internally during rendering.
|
|
|
+ 使用内置摄像头生成的深度图;超出像素深度的位置在阴影中。在渲染期间内部计算。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
<h3>[property:Vector2 mapSize]</h3>
|
|
|
<p>
|
|
|
- A [Page:Vector2] defining the width and height of the shadow map.<br /><br />
|
|
|
+ 一个[Page:Vector2]定义阴影贴图的宽度和高度。<br /><br />
|
|
|
|
|
|
- Higher values give better quality shadows at the cost of computation time. Values must be
|
|
|
- powers of 2, up to the [page:WebGLRenderer.capabilities].maxTextureSize for a given device,
|
|
|
- although the width and height don't have to be the same (so, for example, (512, 1024) is valid).
|
|
|
- The default is *( 512, 512 )*.
|
|
|
+ 较高的值会以计算时间为代价提供更好的阴影质量。值必须是2的幂,直到给定设备的[page:WebGLRenderer.capabilities].maxTextureSize,
|
|
|
+ 虽然宽度和高度不必相同(例如,(512,1024)有效)。
|
|
|
+ 默认值为*(512,512)*。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
<h3>[property:Matrix4 matrix]</h3>
|
|
|
<p>
|
|
|
- Model to shadow camera space, to compute location and depth in shadow map. Stored
|
|
|
- in a [page:Matrix4 Matrix4]. This is computed internally during rendering.
|
|
|
+ 模拟阴影相机空间,计算阴影贴图中的位置和深度。存储在[page:Matrix4 Matrix4]中。这是在渲染期间内部计算的。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Float radius]</h3>
|
|
|
<p>
|
|
|
- Setting this to values greater than 1 will blur the edges of the shadow.<br />
|
|
|
+ 将此值设置为大于1的值将模糊阴影的边缘。<br />
|
|
|
|
|
|
- High values will cause unwanted banding effects in the shadows - a greater [page:.mapSize mapSize]
|
|
|
- will allow for a higher value to be used here before these effects become visible.<br /><br />
|
|
|
|
|
|
- Note that this has no effect if the [page:WebGLRenderer.shadowMap.type] is set to [page:Renderer BasicShadowMap].
|
|
|
+ 较高的值会在阴影中产生不必要的条带效果 - 更大的[page:.mapSize mapSize]将允许在这些效果变得可见之前使用更高的值。<br /><br />
|
|
|
+
|
|
|
+ 请注意,如果[page:WebGLRenderer.shadowMap.type]设置为[page:Renderer BasicShadowMap],将会无效。
|
|
|
+
|
|
|
</p>
|
|
|
|
|
|
|
|
|
- <h2>Methods</h2>
|
|
|
+ <h2>方法</h2>
|
|
|
<h3>[method:LightShadow copy]( [param:LightShadow source] )</h3>
|
|
|
<p>
|
|
|
- Copies value of all the properties from the [page:LightShadow source] to this
|
|
|
- SpotLight.
|
|
|
+ 将[page:LightShadow]中的所有属性的值复制到 SpotLight。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:LightShadow clone]()</h3>
|
|
|
<p>
|
|
|
- Creates a new LightShadow with the same properties as this one.
|
|
|
+ 克隆与此相同属性的新LightShadow。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Object toJSON]()</h3>
|
|
|
<p>
|
|
|
- Serialize this LightShadow.
|
|
|
+ 序列化这个LightShadow。
|
|
|
</p>
|
|
|
|
|
|
- <h2>Source</h2>
|
|
|
+ <h2>源码</h2>
|
|
|
|
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/lights/[name].js src/lights/[name].js]
|
|
|
</body>
|