Skip to content

Commit

Permalink
Docs: Added FramebufferTexture page. (#22917)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Nov 29, 2021
1 parent e9c4f92 commit bd0d707
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/api/en/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ <h3>[method:undefined clearStencil]( )</h3>
<h3>[method:undefined 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:undefined copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:Number level] )</h3>
<h3>[method:undefined copyFramebufferToTexture]( [param:Vector2 position], [param:FramebufferTexture texture], [param:Number level] )</h3>
<p>Copies pixels from the current WebGLFramebuffer into a 2D texture. Enables access to [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/copyTexImage2D WebGLRenderingContext.copyTexImage2D].</p>

<h3>[method:undefined copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
Expand Down
51 changes: 51 additions & 0 deletions docs/api/en/textures/FramebufferTexture.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Texture] &rarr;

<h1>[name]</h1>

<p class="desc">
This class can only be used in combination with [page:WebGLRenderer.copyFramebufferToTexture]().
</p>

<h2>Constructor</h2>
<h3>[name]( [param:Number width], [param:Number height], [param:Constant format] )</h3>
<p>
[page:Number width] -- The width of the texture.<br />

[page:Number height] -- The height of the texture.<br />

[page:Constant format] -- The format used in the texture.
See [page:Textures format constants] for other choices.<br />
</p>


<h2>Properties</h2>

<p>See the base [page:Texture Texture] class for common properties.</p>

<h3>[property:Boolean needsUpdate]</h3>

<p>
True by default. This is required so that the canvas data is loaded.
</p>

<h2>Methods</h2>

<p>See the base [page:Texture Texture] class for common methods.</p>


<h2>Source</h2>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/api/zh/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ <h3>[method:undefined clearTarget]([param:WebGLRenderTarget renderTarget], [para
<h3>[method:undefined compile]( [param:Object3D scene], [param:Camera camera] )</h3>
<p>使用相机编译场景中的所有材质。这对于在首次渲染之前预编译着色器很有用。</p>

<h3>[method:undefined copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:Number level] )</h3>
<h3>[method:undefined copyFramebufferToTexture]( [param:Vector2 position], [param:FramebufferTexture texture], [param:Number level] )</h3>
<p>将当前WebGLFramebuffer中的像素复制到2D纹理中。可访问[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/copyTexImage2D WebGLRenderingContext.copyTexImage2D].</p>

<h3>[method:undefined copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
Expand Down
47 changes: 47 additions & 0 deletions docs/api/zh/textures/FramebufferTexture.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Texture] &rarr;

<h1>[name]</h1>

<p class="desc">
This class can only be used in combination with [page:WebGLRenderer.copyFramebufferToTexture]().
</p>

<h2>Constructor</h2>
<h3>[name]( [param:Number width], [param:Number height], [param:Constant format] )</h3>
<p>
[page:Number width] -- The width of the texture.<br />

[page:Number height] -- The height of the texture.<br />

[page:Constant format] -- The format used in the texture.
See [page:Textures format constants] for other choices.<br />
</p>


<h2>Properties</h2>

<p>See the base [page:Texture Texture] class for common properties.</p>

<h3>[property:Boolean needsUpdate]</h3>

<h2>Methods</h2>

<p>See the base [page:Texture Texture] class for common methods.</p>


<h2>Source</h2>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>
2 changes: 2 additions & 0 deletions docs/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@
"DataTexture2DArray": "api/en/textures/DataTexture2DArray",
"DataTexture3D": "api/en/textures/DataTexture3D",
"DepthTexture": "api/en/textures/DepthTexture",
"FramebufferTexture": "api/en/textures/FramebufferTexture",
"Texture": "api/en/textures/Texture",
"VideoTexture": "api/en/textures/VideoTexture"
}
Expand Down Expand Up @@ -817,6 +818,7 @@
"DataTexture2DArray": "api/zh/textures/DataTexture2DArray",
"DataTexture3D": "api/zh/textures/DataTexture3D",
"DepthTexture": "api/zh/textures/DepthTexture",
"FramebufferTexture": "api/zh/textures/FramebufferTexture",
"Texture": "api/zh/textures/Texture",
"VideoTexture": "api/zh/textures/VideoTexture"
}
Expand Down

0 comments on commit bd0d707

Please sign in to comment.