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

Material QML Type

Non-creatable abstract base for materials.

This type was introduced in Qt 5.5.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Material QML Type

Detailed Description

Material provides a way to specify the rendering of an entity. Any aspect can define its own subtype of Material so that a Material can be used to describe a visual element; for example, the way sound should reflect off an element, the temperature of a surface, and so on.

In itself, a Material doesn't do anything. It's only when it references an Effect node that a Material becomes useful.

In practice, it often happens that a single Effect is being referenced by several Material components. This allows to only create the effect, techniques, passes and shaders once while allowing to specify the material by adding Parameter instances.

A Parameter defined on a Material overrides parameter (of the same name) defined in a Effect, Technique and RenderPass, but are overridden by parameters in RenderPassFilter and TechniqueFilter.

 
Sélectionnez
Effect {
    id: effect

    techniques: [
        Technique {
            id: gl3Technique
            graphicsApiFilter {
                api: GraphicsApiFilter.OpenGL
                profile: GraphicsApiFilter.CoreProfile
                majorVersion: 3
                minorVersion: 1
            }
            renderPasses: [
                RenderPass {
                    id: gl3Pass
                    shaderProgram: ShaderProgram {
                        ...
                    }
                }
            ]
        }
    ]
}

Material {
    id: material1
    parameters: [
        Parameter { name: "color"; value: "green" }
    ]
}

Material {
    id: material2
    parameters: [
        Parameter { name: "color"; value: "white" }
    ]
}

See Also

Property Documentation

 

effect : Effect

Specifies the effect to be used with the material.

parameters : list<Parameter>

Holds the list of parameters used by the material.

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