Răsfoiți Sursa

docs: translate the FramebufferTexture(zh) (#26073)

* manual: fix wrong word(zh)

* fix a wrong word(zh)

* docs: translate the FramebufferTexture(zh)

---------

Co-authored-by: 柳江南 <[email protected]>
LJNaN 2 ani în urmă
părinte
comite
cb8e47380e

+ 1 - 1
docs/api/zh/textures/DepthTexture.html

@@ -9,7 +9,7 @@
 	<body>
 		[page:Texture] &rarr;
 
-		<h1>深度纹理([name])</h1>
+		<h1>深度纹理([name])</h1>
 
 		<p class="desc">
 		This class can be used to automatically save the depth information of a rendering into a texture.

+ 55 - 11
docs/api/zh/textures/FramebufferTexture.html

@@ -9,38 +9,82 @@
 	<body>
 		[page:Texture] &rarr;
 
-		<h1>[name]</h1>
+		<h1>帧缓冲纹理([name])</h1>
 
 		<p class="desc">
-			This class can only be used in combination with [page:WebGLRenderer.copyFramebufferToTexture]().
+			这个类只能与 [page:WebGLRenderer.copyFramebufferToTexture]() 结合使用。
 		</p>
 
-		<h2>Constructor</h2>
+		<code>
+		const pixelRatio = window.devicePixelRatio;
+		const textureSize = 128 * pixelRatio;
+
+		// instantiate a framebuffer texture
+		const frameTexture = new FramebufferTexture( textureSize, textureSize );
+
+		// calculate start position for copying part of the frame data
+		const vector = new Vector2();
+		vector.x = ( window.innerWidth * pixelRatio / 2 ) - ( textureSize / 2 );
+		vector.y = ( window.innerHeight * pixelRatio / 2 ) - ( textureSize / 2 );
+
+		// render the scene
+		renderer.clear();
+		renderer.render( scene, camera );
+
+		// copy part of the rendered frame into the framebuffer texture
+		renderer.copyFramebufferToTexture( vector, frameTexture );
+		</code>
+
+		<h2>例子</h2>
+
+		<p>[example:webgl_framebuffer_texture]</p>
+
+		<h2>构造函数</h2>
 		<h3>[name]( [param:Number width], [param:Number height] )</h3>
 		<p>
-		[page:Number width] -- The width of the texture.<br />
+		[page:Number width] -- 纹理的宽度<br />
+
+		[page:Number height] -- 纹理的高度<br /><br />
 
-		[page:Number height] -- The height of the texture.
 		</p>
 
 
-		<h2>Properties</h2>
+		<h2>属性</h2>
 
-		<p>See the base [page:Texture Texture] class for common properties.</p>
+		<p>共有属性请参见其基类 [page:Texture Texture] </p>
+
+		<h3>[property:Boolean generateMipmaps]</h3>
+		<p>是否为 [name] 生成 mipmaps ,默认为`false`</p>
 
 		<h3>[property:Boolean isFramebufferTexture]</h3>
+		<p>只读,检查给定对象是否为 [name] 类型</p>
+
+		<h3>[property:number magFilter]</h3>
+		<p>
+			纹理元素覆盖多个像素时如何对纹理进行采样。默认值为 [page:Textures THREE.NearestFilter] ,它使用最接近的纹理元素。
+			<br /><br />
+
+			更多细节详见 [page:Textures texture constants]
+		</p>
+
+		<h3>[property:number minFilter]</h3>
 		<p>
-			Read-only flag to check if a given object is of type [name].
+			纹理元素覆盖少于一个像素时如何对纹理进行采样。默认值为 [page:Textures THREE.NearestFilter] ,它使用最近的纹理元素。
+			<br /><br />
+
+			更多细节详见 [page:Textures texture constants]
 		</p>
 
 		<h3>[property:Boolean needsUpdate]</h3>
 
-		<h2>Methods</h2>
+		<p>默认为 `true` ,这是加载 canvas 数据所必需的</p>
+
+		<h2>方法</h2>
 
-		<p>See the base [page:Texture Texture] class for common methods.</p>
+		<p>共有方法请参见其基类 [page:Texture Texture] </p>
 
 
-		<h2>Source</h2>
+		<h2>源代码</h2>
 
 		<p>
 			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 1 - 1
manual/zh/textures.html

@@ -325,7 +325,7 @@ loadManager.onLoad = () =&gt; {
 </div>
 
 <p>这样就更清楚了。在左上角和中上角你可以看到第一个mip一直用到了远处。右上角和中下角你可以清楚地看到哪里使用了不同的mip。</p>
-<p>切换回原来的纹理,你可以看到右下角是最平滑的,质量最高的。你可能会问为什么不总是使用这种模式。最明显的原因是有时你希望东西是像素化的,以达到复古的效果或其他原因。其次最常见的原因是,读取8个像素并混合它们比读取1个像素并混合要慢。虽然单个纹理不太可能成为快和慢的区别,但随着我们在这些文章中的进一步深入,我们最终会有同时使用4或5个纹理的材料的情况。4个纹理*每个纹理8个像素,就是查找32个像素的永远渲染的像素。在移动设备上,这一可能需要被重点考虑。</p>
+<p>切换回原来的纹理,你可以看到右下角是最平滑的,质量最高的。你可能会问为什么不总是使用这种模式。最明显的原因是有时你希望东西是像素化的,以达到复古的效果或其他原因。其次最常见的原因是,读取8个像素并混合它们比读取1个像素并混合要慢。虽然单个纹理不太可能成为快和慢的区别,但随着我们在这些文章中的进一步深入,我们最终会有同时使用4或5个纹理的材料的情况。4个纹理*每个纹理8个像素,就是查找32个像素的永远渲染的像素。在移动设备上,这一可能需要被重点考虑。</p>
 <h2 id="-a-name-uvmanipulation-a-"><a name="uvmanipulation"></a> 重复,偏移,旋转,包裹一个纹理</h2>
 <p>纹理有重复、偏移和旋转纹理的设置。</p>
 <p>默认情况下,three.js中的纹理是不重复的。要设置纹理是否重复,有2个属性,<a href="/docs/#api/zh/textures/Texture#wrapS"><code class="notranslate" translate="no">wrapS</code></a> 用于水平包裹,<a href="/docs/#api/zh/textures/Texture#wrapT"><code class="notranslate" translate="no">wrapT</code></a> 用于垂直包裹。</p>