Skip to content

Commit

Permalink
Merge pull request #19564 from martinRenou/render_input
Browse files Browse the repository at this point in the history
WebGLRenderer render method type definition: accept Object3D as first argument
  • Loading branch information
mrdoob authored Jun 12, 2020
2 parents 563c210 + e0ff902 commit ad326f0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/api/en/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ <h3>[method:null clearDepth]( )</h3>
<h3>[method:null clearStencil]( )</h3>
<p>Clear the stencil buffers. Equivalent to calling [page:WebGLRenderer.clear .clear]( false, false, true ).</p>

<h3>[method:null compile]( [param:Scene scene], [param:Camera camera] )</h3>
<h3>[method:null compile]( [param:Object3D scene], [param:Camera camera] )</h3>
<p>Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first rendering.</p>

<h3>[method:null copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:Number level] )</h3>
Expand Down Expand Up @@ -404,9 +404,9 @@ <h3>[method:null readRenderTargetPixels]( [param:WebGLRenderTarget renderTarget]
<p>For reading out a [page:WebGLCubeRenderTarget WebGLCubeRenderTarget] use the optional parameter activeCubeFaceIndex to determine which face should be read.</p>


<h3>[method:null render]( [param:Scene scene], [param:Camera camera] )</h3>
<h3>[method:null render]( [param:Object3D scene], [param:Camera camera] )</h3>
<p>
Render a [page:Scene scene] using a [page:Camera camera].<br />
Render a [page:Scene scene] or another type of [page:Object3D object] using a [page:Camera camera].<br />

The render is done to a previously specified [page:WebGLRenderTarget renderTarget] set by calling [page:WebGLRenderer.setRenderTarget .setRenderTarget] or to the canvas as usual.<br />

Expand Down
4 changes: 2 additions & 2 deletions docs/api/zh/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ <h3>[method:null clearTarget]([param:WebGLRenderTarget renderTarget], [param:boo
该方法清楚了一个rendertarget。为此它会激活此endertarget
</p>

<h3>[method:null compile]( [param:Scene scene], [param:Camera camera] )</h3>
<h3>[method:null compile]( [param:Object3D scene], [param:Camera camera] )</h3>
<p>使用相机编译场景中的所有材质。这对于在首次渲染之前预编译着色器很有用。</p>

<h3>[method:null copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:Number level] )</h3>
Expand Down Expand Up @@ -361,7 +361,7 @@ <h3>[method:null readRenderTargetPixels]( [param:WebGLRenderTarget renderTarget]
示例:[example:webgl_interactive_cubes_gpu interactive / cubes / gpu]</p>
<p>For reading out a [page:WebGLCubeRenderTarget WebGLCubeRenderTarget] use the optional parameter activeCubeFaceIndex to determine which face should be read.</p>

<h3>[method:null render]( [param:Scene scene], [param:Camera camera], [param:WebGLRenderTarget renderTarget], [param:Boolean forceClear] )</h3>
<h3>[method:null render]( [param:Object3D scene], [param:Camera camera] )</h3>
<p>
用相机([page:Camera camera])渲染一个场景([page:Scene scene])<br />

Expand Down
8 changes: 4 additions & 4 deletions src/renderers/WebGLRenderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -333,12 +333,12 @@ 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;

/**
* 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.
*
Expand All @@ -349,7 +349,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;

Expand Down

0 comments on commit ad326f0

Please sign in to comment.