IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

RenderStateSet QML Type

The RenderStateSet FrameGraph node offers a way of specifying a set of RenderState objects to be applied during the execution of a framegraph branch.

This type was introduced in Qt 5.5.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

RenderStateSet QML Type

  • Import Statement: import Qt3D.Render 2.4

  • Since:: Qt 5.5

  • Inherits:: FrameGraphNode

  • Instantiates:: QRenderStateSet

Detailed Description

States set on a RenderStateSet are set globally, contrary to the per-material states that can be set on a RenderPass. By default, an empty RenderStateSet will result in all render states being disabled when executed. Adding a RenderState state explicitly enables that render state at runtime.

The RenderStateSet is enabled when added to the active frame graph:

 
Sélectionnez
import Qt3D.Core 2.0
import Qt3D.Render 2.0
import Qt3D.Extras 2.0

Entity {
    id: rootNode
    components: [
        RenderSettings {
            activeFrameGraph: RenderSurfaceSelector {
                ClearBuffers {
                    buffers : ClearBuffers.ColorDepthBuffer

                    CameraSelector {
                        camera: Camera {
                            position: Qt.vector3d(10, 0, 0)
                            viewCenter: Qt.vector3d(0, 0, 0)
                        }
                        RenderStateSet {
                            renderStates: [
                                CullFace { mode: CullFace.Back }
                            ]
                        }
                    }
                }
            }
        }
    ]

    Entity {
        id: sphereEntity
        components: [
            GeometryRenderer { view: SphereMesh {} },
            PhongMaterial {}
        ]
    }
}

See Also

Property Documentation

 

renderStates : list<RenderState>

Holds the list of RenderState objects used by the RenderStateSet.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+