Describes state changes that the material wants to apply to the currently active graphics pipeline state.
Unlike QSGMaterialShader
, directly issuing state change commands with the underlying graphics API is not possible with QSGMaterialShader
. This is mainly because the concept of individually changeable states is considered deprecated and not supported with modern graphics APIs.
Therefore, it is up to QSGMaterialShader
to expose a data structure with the set of supported states, which the material can change in its updatePipelineState() implementation, if there is one. The scenegraph will then internally apply these changes to the active graphics pipeline state, then rolling them back as appropriate.
When updateGraphicsPipelineState()
is called, the struct has all members set to a valid value to reflect the renderer’s current state. Not changing any values (or not reimplementing the function) indicates that the material is fine with the defaults (which are dynamic however, depending on QSGMaterial
flags, for example).
Constant
Description
QSGMaterialShader.GraphicsPipelineState.Zero
QSGMaterialShader.GraphicsPipelineState.One
QSGMaterialShader.GraphicsPipelineState.SrcColor
QSGMaterialShader.GraphicsPipelineState.OneMinusSrcColor
QSGMaterialShader.GraphicsPipelineState.DstColor
QSGMaterialShader.GraphicsPipelineState.OneMinusDstColor
QSGMaterialShader.GraphicsPipelineState.SrcAlpha
QSGMaterialShader.GraphicsPipelineState.OneMinusSrcAlpha
QSGMaterialShader.GraphicsPipelineState.DstAlpha
QSGMaterialShader.GraphicsPipelineState.OneMinusDstAlpha
QSGMaterialShader.GraphicsPipelineState.ConstantColor
QSGMaterialShader.GraphicsPipelineState.OneMinusConstantColor
QSGMaterialShader.GraphicsPipelineState.ConstantAlpha
QSGMaterialShader.GraphicsPipelineState.OneMinusConstantAlpha
QSGMaterialShader.GraphicsPipelineState.SrcAlphaSaturate
QSGMaterialShader.GraphicsPipelineState.Src1Color
QSGMaterialShader.GraphicsPipelineState.OneMinusSrc1Color
QSGMaterialShader.GraphicsPipelineState.Src1Alpha
QSGMaterialShader.GraphicsPipelineState.OneMinusSrc1Alpha
Constant
Description
QSGMaterialShader.GraphicsPipelineState.R
QSGMaterialShader.GraphicsPipelineState.G
QSGMaterialShader.GraphicsPipelineState.B
QSGMaterialShader.GraphicsPipelineState.A
Constant
Description
QSGMaterialShader.GraphicsPipelineState.CullNone
QSGMaterialShader.GraphicsPipelineState.CullFront
QSGMaterialShader.GraphicsPipelineState.CullBack
Specifies the polygon rasterization mode
Polygon Mode (Triangle Fill Mode in Metal, Fill Mode in D3D) specifies the fill mode used when rasterizing polygons. Polygons may be drawn as solids (Fill), or as a wire mesh (Line).
Warning
OpenGL ES does not support the Line
polygon mode. OpenGL ES will rasterize all polygons as filled no matter what polygon mode is set. Using Line
will make your application non-portable.
Constant |
Description |
---|---|
QSGMaterialShader.GraphicsPipelineState.Fill |
The interior of the polygon is filled (default) |
QSGMaterialShader.GraphicsPipelineState.Line |
Boundary edges of the polygon are drawn as line segments. |
This variable holds Blend constant applicable when a blending factor is set to use a constant value..
This variable holds Enables blending..
Note
Changing this flag should be done with care, and is best avoided. Rather, materials should always use the QSGMaterial::Blend flag to indicate that they wish to use blending. Changing this value from false to true for a material that did not declare QSGMaterial::Blend can lead to unexpected visual results.
This variable holds Color write mask..
This variable holds Cull mode..
This variable holds Destination alpha blending factor..
Applies only when separateBlendFactors is set to true.
This variable holds Destination blending factor, either RGB or RGBA depending on separateBlendFactors ..
This variable holds Polygon rasterization mode..
This variable holds Indicates that alpha blending factors are specified separately..
False by default, meaning both RGB and alpha blending factors are defined by srcColor and dstColor . When set to true, the alpha blending factors are taken from srcAlpha and dstAlpha instead, and srcColor and dstColor applies only to RGB.
This variable holds Source alpha blending factor..
Applies only when separateBlendFactors is set to true.
This variable holds Source blending factor, either RGB or RGBA depending on separateBlendFactors ..