Capítulo 227 de 859
This class can only be used in combination with copyFramebufferToTexture() methods of renderers. It extracts the contents of the current bound framebuffer and provides it as a texture for further usage.
const pixelRatio = window.devicePixelRatio;
const textureSize = 128 * pixelRatio;
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 );
renderer.render( scene, camera );
// copy part of the rendered frame into the framebuffer texture
renderer.copyFramebufferToTexture( frameTexture, vector );
Constructor
| Signature |
|---|
new FramebufferTexture( width : number, height : number ) |
Properties
| Property | Description |
|---|---|
.generateMipmaps : boolean | Whether to generate mipmaps (if possible) for a texture. |
.isFramebufferTexture : boolean (readonly) | This flag can be used for type testing. |
| `.magFilter : NearestFilter | NearestMipmapNearestFilter |
| `.minFilter : NearestFilter | NearestMipmapNearestFilter |