PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat¶
- class QOpenGLFramebufferObjectFormat¶
QOpenGLFramebufferObjectFormat
类指定了 OpenGL 帧缓冲对象的格式。更多…概要¶
方法¶
def
__init__()
def
attachment()
def
mipmap()
def
__ne__()
def
__eq__()
def
samples()
def
setAttachment()
def
setMipmap()
def
setSamples()
def
textureTarget()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
帧缓冲对象具有以下几个特点:
请注意,硬件驱动程序可能不支持所需的附件或每个像素的样本数量。在创建
QOpenGLFramebufferObject
后,调用QOpenGLFramebufferObject::format()以查找用于创建帧缓冲对象的确切格式。- __init__()¶
创建一个
QOpenGLFramebufferObjectFormat
对象,用于指定OpenGL帧缓冲对象的格式。默认情况下,格式指定了一个没有深度/模板附件的非多重采样帧缓冲对象,纹理目标为
GL_TEXTURE_2D
,内部格式为GL_RGBA8
。在OpenGL/ES系统上,默认的内部格式是GL_RGBA
。- __init__(other)
- Parameters:
构造
other
的副本。返回附加到帧缓冲对象的深度和模板缓冲区的配置。默认值为
NoAttachment
。另请参阅
- internalTextureFormat()¶
- Return type:
整数
返回帧缓冲对象的纹理或多重采样帧缓冲对象的颜色缓冲区的内部格式。在桌面OpenGL系统上,默认是
GL_RGBA8
,在OpenGL/ES系统上,默认是GL_RGBA
。- mipmap()¶
- Return type:
布尔
如果启用了mipmapping,则返回
true
。另请参阅
- __ne__(other)¶
- Parameters:
- Return type:
布尔
如果此帧缓冲对象格式的所有选项与
other
相同,则返回false
;否则返回true
。- __eq__(other)¶
- Parameters:
- Return type:
布尔
如果此帧缓冲对象格式的所有选项与
other
相同,则返回true
;否则返回false
。- samples()¶
- Return type:
整数
如果帧缓冲对象是多采样帧缓冲对象,则返回每个像素的样本数。否则,返回0。默认值为0。
另请参阅
- setAttachment(attachment)¶
- Parameters:
附件 –
Attachment
将帧缓冲对象的附件配置设置为
attachment
。另请参阅
- setInternalTextureFormat(internalTextureFormat)¶
- Parameters:
internalTextureFormat – int
将帧缓冲对象的纹理或多重采样帧缓冲对象的颜色缓冲区的内部格式设置为
internalTextureFormat
。- setMipmap(enabled)¶
- Parameters:
enabled – 布尔值
如果
enabled
为true,则启用mipmapping;否则禁用它。Mipmapping 默认是禁用的。
如果启用了mipmapping,将为mipmap级别分配额外的内存。可以通过绑定纹理并调用glGenerateMipmap()来更新mipmap级别。对于多重采样的帧缓冲对象,无法启用mipmapping。
- setSamples(samples)¶
- Parameters:
样本 – int
设置多采样帧缓冲对象每个像素的样本数为
samples
。默认样本计数为0,表示常规的非多采样帧缓冲对象。如果硬件不支持每个像素所需的采样数量,则将使用每个像素的最大采样数量。请注意,多重采样帧缓冲对象不能绑定为纹理。此外,创建每个像素有多个采样的帧缓冲需要
GL_EXT_framebuffer_multisample
扩展。另请参阅
- setTextureTarget(target)¶
- Parameters:
目标 – 整数
将附加到帧缓冲对象的纹理的纹理目标设置为
target
。对于多重采样帧缓冲对象,此设置将被忽略。另请参阅
- textureTarget()¶
- Return type:
整数
返回附加到帧缓冲对象的纹理的纹理目标。对于多重采样帧缓冲对象忽略此设置。默认值为
GL_TEXTURE_2D
。