From 7cc394ffb538c7927cff6b28a77f6e3fa6cd8ccb Mon Sep 17 00:00:00 2001
From: Mugen87 مثال التعليمة البرمجية
// Create cube render target
- const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { format: THREE.RGBFormat, generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
+ const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
// Create cube camera
const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget );
diff --git a/docs/api/en/cameras/CubeCamera.html b/docs/api/en/cameras/CubeCamera.html
index 10f37354d2cc1e..884ccb796b90c0 100644
--- a/docs/api/en/cameras/CubeCamera.html
+++ b/docs/api/en/cameras/CubeCamera.html
@@ -17,7 +17,7 @@
Code Example
// Create cube render target
- const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { format: THREE.RGBFormat, generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
+ const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
// Create cube camera
const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget );
diff --git a/docs/api/en/materials/Material.html b/docs/api/en/materials/Material.html
index aafcdc6f6374a5..6ccdab1672467d 100644
--- a/docs/api/en/materials/Material.html
+++ b/docs/api/en/materials/Material.html
@@ -128,11 +128,6 @@
[property:Boolean depthWrite]
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
- When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat]. -
-Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be *true*. Default is *false*. diff --git a/docs/api/en/textures/DataTexture.html b/docs/api/en/textures/DataTexture.html index d621a206f818fb..d54a8ce529a407 100644 --- a/docs/api/en/textures/DataTexture.html +++ b/docs/api/en/textures/DataTexture.html @@ -40,7 +40,7 @@
- The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically
- set this to [page:Textures THREE.RGBFormat] for JPG images.
+ The default is [page:Textures THREE.RGBAFormat].
See the [page:Textures texture constants] page for details of other formats.
// Create cube render target
- const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { format: THREE.RGBFormat, generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
+ const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
// Create cube camera
const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget );
diff --git a/docs/api/zh/cameras/CubeCamera.html b/docs/api/zh/cameras/CubeCamera.html
index 79f79d2376ddfc..dc6b683342135d 100644
--- a/docs/api/zh/cameras/CubeCamera.html
+++ b/docs/api/zh/cameras/CubeCamera.html
@@ -17,7 +17,7 @@ 代码示例
// Create cube render target
- const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { format: THREE.RGBFormat, generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
+ const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
// Create cube camera
const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget );
diff --git a/docs/api/zh/materials/Material.html b/docs/api/zh/materials/Material.html
index 1312e7f86460f1..2fc04c98848b75 100644
--- a/docs/api/zh/materials/Material.html
+++ b/docs/api/zh/materials/Material.html
@@ -107,11 +107,6 @@ [property:Boolean depthWrite]
在绘制2D叠加时,将多个事物分层在一起而不创建z-index时,禁用深度写入会很有用。
-[property:Number format]
-
-When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
-
-
[property:Boolean stencilWrite]
Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be *true*. Default is *false*.
diff --git a/docs/api/zh/textures/DataTexture.html b/docs/api/zh/textures/DataTexture.html
index c75cd9015b234f..d0f6aef2962b68 100644
--- a/docs/api/zh/textures/DataTexture.html
+++ b/docs/api/zh/textures/DataTexture.html
@@ -40,7 +40,7 @@
代码示例
const height = 512;
const size = width * height;
- const data = new Uint8Array( 3 * size );
+ const data = new Uint8Array( 4 * size );
const color = new THREE.Color( 0xffffff );
const r = Math.floor( color.r * 255 );
@@ -49,17 +49,18 @@ 代码示例
for ( let i = 0; i < size; i ++ ) {
- const stride = i * 3;
+ const stride = i * 4;
data[ stride ] = r;
data[ stride + 1 ] = g;
data[ stride + 2 ] = b;
+ data[ stride + 3 ] = 255;
}
// used the buffer to create a [name]
- const texture = new THREE.DataTexture( data, width, height, THREE.RGBFormat );
+ const texture = new THREE.DataTexture( data, width, height );
texture.needsUpdate = true;
diff --git a/docs/api/zh/textures/DataTexture2DArray.html b/docs/api/zh/textures/DataTexture2DArray.html
index bfeb569fa6d303..bd40b681869519 100644
--- a/docs/api/zh/textures/DataTexture2DArray.html
+++ b/docs/api/zh/textures/DataTexture2DArray.html
@@ -43,7 +43,7 @@ 代码示例
const depth = 100;
const size = width * height;
- const data = new Uint8Array( 3 * size * depth );
+ const data = new Uint8Array( 4 * size * depth );
for ( let i = 0; i < depth; i ++ ) {
@@ -54,11 +54,12 @@ 代码示例
for ( let j = 0; j < size; j ++ ) {
- const stride = ( i * size + j ) * 3;
+ const stride = ( i * size + j ) * 4;
data[ stride ] = r;
data[ stride + 1 ] = g;
data[ stride + 2 ] = b;
+ data[ stride + 3 ] = 255;
}
}
@@ -66,7 +67,6 @@ 代码示例
// used the buffer to create a [name]
const texture = new THREE.DataTexture2DArray( data, width, height, depth );
- texture.format = THREE.RGBFormat;
texture.needsUpdate = true;
diff --git a/docs/api/zh/textures/Texture.html b/docs/api/zh/textures/Texture.html
index 2a72f530b7f795..79564c296c79f7 100644
--- a/docs/api/zh/textures/Texture.html
+++ b/docs/api/zh/textures/Texture.html
@@ -110,8 +110,7 @@
- 默认值为[page:Textures THREE.RGBAFormat],
- 但[page:TextureLoader TextureLoader]将会在载入JPG图片时自动将这个值设置为[page:Textures THREE.RGBFormat]。
+ 默认值为[page:Textures THREE.RGBAFormat]。
请参阅[page:Textures texture constants]页面来了解其它格式。