From bd28175f570247b9b7e8438c0d2f509db65cea4d Mon Sep 17 00:00:00 2001 From: martinRenou Date: Fri, 5 Jun 2020 12:31:22 +0200 Subject: [PATCH 1/2] WebGLRenderer render method: accept Object3D as first argument Signed-off-by: martinRenou --- docs/api/en/renderers/WebGLRenderer.html | 4 ++-- docs/api/zh/renderers/WebGLRenderer.html | 2 +- src/renderers/WebGLRenderer.d.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/api/en/renderers/WebGLRenderer.html b/docs/api/en/renderers/WebGLRenderer.html index 118202d400ce06..55f3c9ec5eaa65 100644 --- a/docs/api/en/renderers/WebGLRenderer.html +++ b/docs/api/en/renderers/WebGLRenderer.html @@ -409,9 +409,9 @@

[method:null readRenderTargetPixels]( [param:WebGLRenderTarget renderTarget]

For reading out a [page:WebGLCubeRenderTarget WebGLCubeRenderTarget] use the optional parameter activeCubeFaceIndex to determine which face should be read.

-

[method:null render]( [param:Scene scene], [param:Camera camera] )

+

[method:null render]( [param:Object3D scene], [param:Camera camera] )

- Render a [page:Scene scene] using a [page:Camera camera].
+ Render a [page:Scene scene] or another type of [page:Object3D object] using a [page:Camera camera].
The render is done to a previously specified [page:WebGLRenderTarget renderTarget] set by calling [page:WebGLRenderer.setRenderTarget .setRenderTarget] or to the canvas as usual.
diff --git a/docs/api/zh/renderers/WebGLRenderer.html b/docs/api/zh/renderers/WebGLRenderer.html index e4b83fca391e92..2414b7fd450c3f 100644 --- a/docs/api/zh/renderers/WebGLRenderer.html +++ b/docs/api/zh/renderers/WebGLRenderer.html @@ -366,7 +366,7 @@

[method:null readRenderTargetPixels]( [param:WebGLRenderTarget renderTarget] 示例:[example:webgl_interactive_cubes_gpu interactive / cubes / gpu]

For reading out a [page:WebGLCubeRenderTarget WebGLCubeRenderTarget] use the optional parameter activeCubeFaceIndex to determine which face should be read.

-

[method:null render]( [param:Scene scene], [param:Camera camera], [param:WebGLRenderTarget renderTarget], [param:Boolean forceClear] )

+

[method:null render]( [param:Object3D scene], [param:Camera camera] )

用相机([page:Camera camera])渲染一个场景([page:Scene scene])
diff --git a/src/renderers/WebGLRenderer.d.ts b/src/renderers/WebGLRenderer.d.ts index 5381807107dedd..efe2c88836bb92 100644 --- a/src/renderers/WebGLRenderer.d.ts +++ b/src/renderers/WebGLRenderer.d.ts @@ -24,7 +24,7 @@ import { Texture } from '../textures/Texture'; export interface Renderer { domElement: HTMLCanvasElement; - render( scene: Scene, camera: Camera ): void; + render( scene: Object3D, camera: Camera ): void; setSize( width: number, height: number, updateStyle?: boolean ): void; } @@ -339,7 +339,7 @@ export class WebGLRenderer implements Renderer { ): void; /** - * Render a scene using a camera. + * Render a scene or an object using a camera. * The render is done to a previously specified {@link WebGLRenderTarget#renderTarget .renderTarget} set by calling * {@link WebGLRenderer#setRenderTarget .setRenderTarget} or to the canvas as usual. * @@ -350,7 +350,7 @@ export class WebGLRenderer implements Renderer { * properties to false. To forcibly clear one ore more buffers call {@link WebGLRenderer#clear .clear}. */ render( - scene: Scene, + scene: Object3D, camera: Camera ): void; From e0ff902f1d15e9d984b5dbca85bcae847f08f04f Mon Sep 17 00:00:00 2001 From: martinRenou Date: Fri, 12 Jun 2020 18:06:13 +0200 Subject: [PATCH 2/2] WebGLRenderer compile method: accept Object3D as first argument Signed-off-by: martinRenou --- docs/api/en/renderers/WebGLRenderer.html | 2 +- docs/api/zh/renderers/WebGLRenderer.html | 2 +- src/renderers/WebGLRenderer.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api/en/renderers/WebGLRenderer.html b/docs/api/en/renderers/WebGLRenderer.html index 55f3c9ec5eaa65..a4ee4e2fcea774 100644 --- a/docs/api/en/renderers/WebGLRenderer.html +++ b/docs/api/en/renderers/WebGLRenderer.html @@ -303,7 +303,7 @@

[method:null clearDepth]( )

[method:null clearStencil]( )

Clear the stencil buffers. Equivalent to calling [page:WebGLRenderer.clear .clear]( false, false, true ).

-

[method:null compile]( [param:Scene scene], [param:Camera camera] )

+

[method:null compile]( [param:Object3D scene], [param:Camera camera] )

Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first rendering.

[method:null copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:Number level] )

diff --git a/docs/api/zh/renderers/WebGLRenderer.html b/docs/api/zh/renderers/WebGLRenderer.html index 2414b7fd450c3f..5e4ebf75b6fb1b 100644 --- a/docs/api/zh/renderers/WebGLRenderer.html +++ b/docs/api/zh/renderers/WebGLRenderer.html @@ -290,7 +290,7 @@

[method:null clearTarget]([param:WebGLRenderTarget renderTarget], [param:boo 该方法清楚了一个rendertarget。为此它会激活此endertarget

-

[method:null compile]( [param:Scene scene], [param:Camera camera] )

+

[method:null compile]( [param:Object3D scene], [param:Camera camera] )

使用相机编译场景中的所有材质。这对于在首次渲染之前预编译着色器很有用。

[method:null copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:Number level] )

diff --git a/src/renderers/WebGLRenderer.d.ts b/src/renderers/WebGLRenderer.d.ts index efe2c88836bb92..7d65b18b1b6b1a 100644 --- a/src/renderers/WebGLRenderer.d.ts +++ b/src/renderers/WebGLRenderer.d.ts @@ -334,7 +334,7 @@ export class WebGLRenderer implements Renderer { * Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first rendering. */ compile( - scene: Scene, + scene: Object3D, camera: Camera ): void;