MultiSampleAntiAliasing QML Type

Enable multisample antialiasing More...

Import Statement: import Qt3D.Render 2.0
Since: Qt 5.7
Instantiates: QMultiSampleAntiAliasing
Inherits:

RenderState

Detailed Description

A MultiSampleAntiAliasing type enables multisample antialiasing.

It can be added to a RenderPass:


  RenderPass {
      shaderProgram: ShaderProgram {
          // ...
      }
      renderStates: [
          MultiSampleAntiAliasing {}
      ]
  }

Or a RenderStateSet:


  RenderStateSet {
      renderStates: [
          MultiSampleAntiAliasing {}
      ]
  }

For multisampling to take effect, the render target must have been allocated with multisampling enabled:


  RenderTarget {
      attachments: [
          RenderTargetOutput {
              attachmentPoint: RenderTargetOutput.Color0
              texture: Texture2DMultisample {
                  width: 1024
                  height: 1024
                  format: Texture.RGBA8_UNorm
              }
          },
          RenderTargetOutput {
              attachmentPoint: RenderTargetOutput.DepthStencil
              texture: Texture2DMultisample{
                  width: 1024
                  height: 1024
                  format: Texture.D24S8
              }
          }
      ]
  }

Further, the shader code must use multisampling sampler types and texelFetch() instead of texture().

Note: When using OpenGL as the graphics API, glEnable(GL_MULTISAMPLE) will be called if MultiSampleAntiAliasing has been added to the render states.