EN
本內容沒有您的語言版本,但有英文版本。

framebufferTexture2D method

Attaches a texture to a WebGLFramebuffer object.

IE11

 

Syntax

WebGLRenderingContext.framebufferTexture2D(target, attachment, textarget, texture, level);

Parameters

target [in]

Type: Number

Always use gl.FRAMEBUFFER.

attachment [in]

Type: Number

gl.COLOR_ATTACHMENT0
gl.DEPTH_ATTACHMENT
gl.STENCIL_ATTACHMENT
gl.DEPTH_STENCIL_ATTACHEMENT
textarget [in]

Type: Number

ValueMeaning
gl.TEXTURE_2D

Uses a 2D image.

gl.TEXTURE_CUBE_MAP_POSITIVE_X

Image for the positive X face of the cube.

gl.TEXTURE_CUBE_MAP_NEGATIVE_X

Image for the negative X face of the cube.

gl.TEXTURE_CUBE_MAP_POSITIVE_Y

Image for the positive Y face of the cube.

gl.TEXTURE_CUBE_MAP_NEGATIVE_Y

Image for the negative Y face of the cube.

gl.TEXTURE_CUBE_MAP_POSITIVE_Z

Image for the positive Z face of the cube.

gl.TEXTURE_CUBE_MAP_NEGATIVE_Z

Image for the negative Z face of the cube.

 

texture [in]

Type: WebGLTexture

WebGLTexture object with image to attach.

level [in]

Type: Number

The mipmap level of the texture image to attach. Always set to 0.

Return value

This method does not return a value.

Remarks

WebGL errorDescription
gl.INVALID_ENUM
  • If textarget isn't from the listed values, and texture isn't 0.
  • If target isn't gl.FRAMEBUFFER.
  • If attachment isn't from the listed values.
gl.INVALID_OPERATION
  • If the default framebuffer object name 0 is bound.
  • If texture isn't 0 or the name of an existing texture object

 

See also

WebGLRenderingContext

 

 

顯示:
© 2014 Microsoft