class QSharedGLTexture#

Allows to use a textureId from a separate OpenGL context in a Qt 3D scene. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QSharedGLTexture

Synopsis#

Properties#

Methods#

Slots#

Signals#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

Depending on the rendering mode used by Qt 3D, the shared context will either be:

  • qt_gl_global_share_context when letting Qt 3D drive the rendering. When setting the attribute Qt::AA_ShareOpenGLContexts on the QApplication class, this will automatically make QOpenGLWidget instances have their context shared with qt_gl_global_share_context.

  • the shared context from the QtQuick scene. You might have to subclass QWindow or use QtQuickRenderControl to have control over what that shared context is though as of 5.13 it is qt_gl_global_share_context.

Any 3rd party engine that shares its context with the Qt 3D renderer can now provide texture ids that will be referenced by the Qt 3D texture.

You can omit specifying the texture properties, Qt 3D will try at runtime to determine what they are. If you know them, you can of course provide them, avoid additional work for Qt 3D.

Keep in mind that if you are using custom materials and shaders, you need to specify the correct sampler type to be used.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property textureIdᅟ: int#

The OpenGL texture id value that you want Qt3D to gain access to.

Access functions:
__init__([parent=None])#
Parameters:

parentQNode

setTextureId(id)#
Parameters:

id – int

See also

textureId()

Setter of property textureIdᅟ .

textureId()#
Return type:

int

See also

setTextureId()

Getter of property textureIdᅟ .

textureIdChanged(textureId)#
Parameters:

textureId – int

Notification signal of property textureIdᅟ .