[page:Texture] →

帧缓冲纹理([name])

这个类只能与 [page:WebGLRenderer.copyFramebufferToTexture]() 结合使用。

const pixelRatio = window.devicePixelRatio; const textureSize = 128 * pixelRatio; // instantiate a framebuffer texture const frameTexture = new FramebufferTexture( textureSize, textureSize ); // calculate start position for copying part of the frame data const vector = new Vector2(); vector.x = ( window.innerWidth * pixelRatio / 2 ) - ( textureSize / 2 ); vector.y = ( window.innerHeight * pixelRatio / 2 ) - ( textureSize / 2 ); // render the scene renderer.clear(); renderer.render( scene, camera ); // copy part of the rendered frame into the framebuffer texture renderer.copyFramebufferToTexture( frameTexture, vector );

例子

[example:webgl_framebuffer_texture]

构造函数

[name]( [param:Number width], [param:Number height] )

[page:Number width] -- 纹理的宽度
[page:Number height] -- 纹理的高度

属性

共有属性请参见其基类 [page:Texture Texture]

[property:Boolean generateMipmaps]

是否为 [name] 生成 mipmaps ,默认为`false`

[property:Boolean isFramebufferTexture]

只读,检查给定对象是否为 [name] 类型

[property:number magFilter]

纹理元素覆盖多个像素时如何对纹理进行采样。默认值为 [page:Textures THREE.NearestFilter] ,它使用最接近的纹理元素。

更多细节详见 [page:Textures texture constants]

[property:number minFilter]

纹理元素覆盖少于一个像素时如何对纹理进行采样。默认值为 [page:Textures THREE.NearestFilter] ,它使用最近的纹理元素。

更多细节详见 [page:Textures texture constants]

[property:Boolean needsUpdate]

默认为 `true` ,这是加载 canvas 数据所必需的

方法

共有方法请参见其基类 [page:Texture Texture]

源代码

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]