Qt 3D Render C++ Classes | Qt 3D 6.4.1

- Qt 6.4
- Qt 3D
- Qt 3D Render C++ Classes
- Qt 6.4.1 Reference Documentation

# Qt 3D Render C++ Classes

The Qt 3D Render module contains functionality to support 2D and 3D rendering using Qt 3D. More...

This module was introduced in Qt 5.7.

## Namespaces

Qt3DRender | Contains classes that enable 2D and 3D rendering

## Classes

Qt3DRender::QAlphaTest | Specify alpha reference test
Qt3DRender::QBlendEquation | Specifies the equation used for both the RGB blend equation and the Alpha blend equation
Qt3DRender::QBlendEquationArguments | Encapsulates blending information: specifies how the incoming values (what's going to be drawn) are going to affect the existing values (what is already drawn)
Qt3DRender::QBlitFramebuffer | FrameGraph node to transfer a rectangle of pixel values from one region of a render target to another
Qt3DRender::QBufferCapture | Exchanges buffer data between GPU and CPU
Qt3DRender::QClearBuffers | Class to clear buffers
Qt3DRender::QClipPlane | Enables an additional OpenGL clipping plane that can be in shaders using gl_ClipDistance
Qt3DRender::QColorMask | Allows specifying which color components should be written to the currently bound frame buffer
Qt3DRender::QCullFace | Specifies whether front or back face culling is enabled
Qt3DRender::QDebugOverlay | Enables a visual overlay with scene details
Qt3DRender::QDepthRange | Enables remapping depth values written into the depth buffer
Qt3DRender::QDepthTest | Tests the fragment shader's depth value against the depth of a sample being written to
Qt3DRender::QDirectionalLight | Encapsulate a Directional Light object in a Qt 3D scene
Qt3DRender::QDispatchCompute | FrameGraph node to issue work for the compute shader on GPU
Qt3DRender::QFrontFace | Defines front and back facing polygons
Qt3DRender::QFrustumCulling | Enable frustum culling for the FrameGraph
Qt3DRender::QLayerFilter | Controls layers drawn in a frame graph branch
Qt3DRender::QLevelOfDetailBoundingSphere | Simple spherical volume, defined by its center and radius
Qt3DRender::QLineWidth | Specifies the width of rasterized lines
Qt3DRender::QMemoryBarrier | Class to emplace a memory barrier
Qt3DRender::QMesh | A custom mesh loader
Qt3DRender::QNoDraw | When a Qt3DRender::QNoDraw node is present in a FrameGraph branch, this prevents the renderer from rendering any primitive
Qt3DRender::QNoPicking | When a Qt3DRender::QNoPicking node is present in a FrameGraph branch, this prevents the render aspect from performing picking selection for the given branch
Qt3DRender::QPaintedTextureImage | A QAbstractTextureImage that can be written through a QPainter
Qt3DRender::QPointLight | Encapsulate a Point Light object in a Qt 3D scene
Qt3DRender::QPointSize | Specifies the size of rasterized points. May either be set statically or by shader programs
Qt3DRender::QPolygonOffset | Sets the scale and steps to calculate depth values for polygon offsets
Qt3DRender::QProximityFilter | Select entities which are within a distance threshold of a target entity
Qt3DRender::QRasterMode | Render state allows to control the type of rasterization to be performed
Qt3DRender::QRayCasterHit | Details of a hit when casting a ray through a model
Qt3DRender::QRenderCapture | Frame graph node for render capture
Qt3DRender::QRenderCaptureReply | Receives the result of render capture request
Qt3DRender::QRenderPassFilter | Provides storage for vectors of Filter Keys and Parameters
Qt3DRender::QRenderStateSet | FrameGraph node offers a way of specifying a set of QRenderState objects to be applied during the execution of a framegraph branch
Qt3DRender::QRenderSurfaceSelector | Provides a way of specifying the render surface
Qt3DRender::QRenderTargetSelector | Provides a way of specifying a render target
Qt3DRender::QScissorTest | Discards fragments that fall outside of a certain rectangular portion of the screen
Qt3DRender::QSetFence | FrameGraphNode used to insert a fence in the graphics command stream
Qt3DRender::QSharedGLTexture | Allows to use a textureId from a separate OpenGL context in a Qt 3D scene
Qt3DRender::QSortPolicy | Provides storage for the sort types to be used
Qt3DRender::QSpotLight | Encapsulate a Spot Light object in a Qt 3D scene
Qt3DRender::QStencilMask | Controls the front and back writing of individual bits in the stencil planes
Qt3DRender::QStencilOperation | Specifies stencil operation
Qt3DRender::QStencilTest | Specifies arguments for the stecil test
Qt3DRender::QSubtreeEnabler | Enables or disables entire subtrees of framegraph nodes
Qt3DRender::QTechniqueFilter | A QFrameGraphNode used to select QTechniques to use
Qt3DRender::QTexture1D | A QAbstractTexture with a Target1D target format
Qt3DRender::QTexture1DArray | A QAbstractTexture with a Target1DArray target format
Qt3DRender::QTexture2D | A QAbstractTexture with a Target2D target format
Qt3DRender::QTexture2DArray | A QAbstractTexture with a Target2DArray target format
Qt3DRender::QTexture2DMultisample | A QAbstractTexture with a Target2DMultisample target format
Qt3DRender::QTexture2DMultisampleArray | A QAbstractTexture with a Target2DMultisampleArray target format
Qt3DRender::QTexture3D | A QAbstractTexture with a Target3D target format
Qt3DRender::QTextureBuffer | A QAbstractTexture with a TargetBuffer target format
Qt3DRender::QTextureCubeMap | A QAbstractTexture with a TargetCubeMap target format
Qt3DRender::QTextureCubeMapArray | A QAbstractTexture with a TargetCubeMapArray target format
Qt3DRender::QTextureData | Stores texture information such as the target, height, width, depth, layers, wrap, and if mipmaps are enabled
Qt3DRender::QTextureDataUpdate | Holds content and information required to perform partial updates of a texture content
Qt3DRender::QTextureGenerator | Provides the image data for a texture
Qt3DRender::QTextureImageData | Stores data representing a texture
Qt3DRender::QTextureLoader | Handles the texture loading and setting the texture's properties
Qt3DRender::QTextureRectangle | A QAbstractTexture with a TargetRectangle target format
Qt3DRender::QViewport | A viewport on the Qt3D Scene
Qt3DRender::QWaitFence | FrameGraphNode used to wait for a fence in the graphics command stream to become signaled

## Detailed Description

The Qt 3D Render module provides an aspect, components, and other supporting types necessary to implement 2D and 3D rendering as part of the Qt 3D framework.

To use classes from this module, add this directive into the C++ files:

     #include <Qt3DRender>

To link against the corresponding C++ library, add the following to your qmake project file:

     QT += 3drender

Classes, types, and functions are declared under the Qt3DRender namespace.

### Overview

The Qt 3D Render aspect offers support for data-driven configuration as described in Qt 3D Render Framegraph.

### Selecting a Rendering Backend

The Render aspect comes with two rendering backends.

- OpenGL backend (ES 2, ES 3.2, GL 2, GL 3, GL 3.2, GL 4.3)
- RHI backend (ES 2, GL, DirectX, Vulkan, Metal)

If you are targeting OpenGL exclusively and are using specific OpenGL features, you might be better off using the OpenGL backend. This is the OpenGL backend that Qt 3D exclusively used in the Qt 5 series.

For cases where you are not using specific OpenGL features and want to target different platforms that might have deprecated OpenGL, using the RHI backend is a better alternative.

To select your rendering backend, the environment variable QT3D_RENDERER is to be set to either "opengl" or "rhi". Defaults to the OpenGL backend.

When using the RHI backend, you can further force the internal RHI backend by setting the QSG_RHI_BACKEND to one of the following values:

- opengl -> RHI OpenGL backend
- gl -> RHI OpenGL backend
- gles2 -> RHI OpenGL backend
- metal -> RHI Metal backend
- vulkan -> RHI Vulkan backend
- d3d11 -> RHI DirectX 11 backend

If not specified, RHI will default to what it deduces to be the best backend for the platform.

### Reference

- Qt 3D Render C++ Classes
- Qt 3D Examples