Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGLRenderer render method type definition: accept Object3D as first argument #19564

Merged
merged 2 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/api/en/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,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 @@ -409,9 +409,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 @@ -290,7 +290,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 @@ -366,7 +366,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 @@ -334,12 +334,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 @@ -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;

Expand Down