summaryrefslogtreecommitdiffstats
path: root/tests/manual/qtbug-76766/Material1.qml
blob: 648891328183635c1fc0afd84be36a23208b40de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

import Qt3D.Core 2.0
import Qt3D.Render 2.0

Material {
    id: root

    property color color:  Qt.rgba(0.15, 0.35, 0.50, 1.0)

    parameters: [
        Parameter { name: "color"; value: Qt.vector3d(root.color.r, root.color.g, root.color.b) }
    ]


    effect: Effect {
        property string vertex: "qrc:/shaders/shader.vert"
        property string fragment: "qrc:/shaders/shader.frag"

        FilterKey {
            id: forward
            name: "renderingStyle"
            value: "forward"
        }

        ShaderProgram {
            id: gl3Shader
            vertexShaderCode: loadSource(parent.vertex)
            fragmentShaderCode: loadSource(parent.fragment)
        }

        techniques: [
            // OpenGL 3.1
            Technique {
                filterKeys: [ forward ]
                graphicsApiFilter {
                    api: GraphicsApiFilter.OpenGL
                    profile: GraphicsApiFilter.CoreProfile
                    majorVersion: 3
                    minorVersion: 3
                }
                renderPasses: RenderPass {
                    filterKeys: [
                        FilterKey {
                            name: "pass"
                            value: 0
                        }
                    ]
                    shaderProgram: gl3Shader
                }
            }
        ]
    }
}