void glFramebufferTexture2D( GLenum target,
GLenum attachment, // FrameBufferObject へバインドする場所
GLenum textarget, // アタッチするテクスチャオブジェクトのタイプ
GLuint texture, // Specifies the texture object to attach to the framebuffer attachment point named by attachment.
// アタッチ(設定)する TextureObject
GLint level // アタッチする TextureObject のミップマップレベルの指定
);
DESC
attach a level of a texture object
as a logical buffer to the currently bound framebuffer object
glFramebufferTexture, glFramebufferTexture1D,
glFramebufferTexture2D,
attach a selected mipmap level or image of a texture object
as one of the logical buffers of the framebuffer object currently bound to target.
target must be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER, or GL_FRAMEBUFFER.
GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER.
attachment
で FrameBufferObject のどこにテクスチャをバインドするか指定する
次のいずれか
GL_COLOR_ATTACHMENTi, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT GL_DEPTH_STENCIL_ATTACHMMENT.
i in GL_COLOR_ATTACHMENTi は以下の範囲
[ 0 : GL_MAX_COLOR_ATTACHMENTS - 1 ]
Attaching a level of a texture to GL_DEPTH_STENCIL_ATTACHMENT is equivalent to attaching that level to both the GL_DEPTH_ATTACHMENT
and the GL_STENCIL_ATTACHMENT attachment points simultaneously.
textarget
specifies what type of texture is named by texture,
and for cube map textures,
specifies the face that is to be attached.
If texture is not zero,
it must be the name of an existing texture with type textarget,
// cubemap でなければ
unless it is a cube map texture,
in which case textarget must be
GL_TEXTURE_CUBE_MAP_POSITIVE_X GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.
texture
If texture is non-zero,
the specified level of the texture object named texture is attached
to the framebfufer attachment point named by attachment.
For glFramebufferTexture1D, glFramebufferTexture2D,
and glFramebufferTexture3D,
texture must be zero or the name of an existing texture with a target of textarget,
or texture must be the name of an existing cube-map texture
and textarget must be one of GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.