aboutsummaryrefslogtreecommitdiffstats
path: root/tests/baseline/data/view3d/AntiAliasing.qml
blob: 842de30c4e490c174101f1372bef5d00c486fc8f (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick
import QtQuick3D
import QtQuick.Controls

Rectangle {
    id: window
    width: 640
    height: 360
    visible: true
    color: "green"

    Node {
        id: standAloneScene

        DirectionalLight {
            brightness: 1.0
            eulerRotation.x: -25
        }

        Model {
            source: "#Cube"
            y: 0
            scale: Qt.vector3d(2, 2, 2)
            eulerRotation : Qt.vector3d(45,45,45)
            materials: [
                DefaultMaterial {
                    diffuseColor: "#FF00FF"
                }
            ]
        }

        OrthographicCamera {
            id: cameraOrthographic
            z: 600
            eulerRotation: Qt.vector3d(0, 0, 0)
        }
    }

    Rectangle {
        id: topLeft
        anchors.top: parent.top
        anchors.left: parent.left
        width: parent.width * 0.5
        height: parent.height
        color: window.color
        border.color: "black"

        View3D {
            id: topLeftView
            anchors.fill: parent
            importScene: standAloneScene
            camera: cameraOrthographic
            environment: SceneEnvironment
            {
                clearColor: window.color
                antialiasingMode: SceneEnvironment.MSAA
                antialiasingQuality: SceneEnvironment.VeryHigh
            }
        }

        Label {
            text: "MSAA VeryHigh"
            anchors.top: parent.top
            anchors.left: parent.left
            anchors.margins: 10
            color: "#222840"
            font.pointSize: 14
        }
    }

    Rectangle {
        id: topRight
        anchors.top: parent.top
        anchors.right: parent.right
        width: parent.width * 0.5
        height: parent.height
        color: window.color
        border.color: "black"

        View3D {
            id: topRightView
            anchors.fill: parent
            importScene: standAloneScene
            camera: cameraOrthographic
            environment: SceneEnvironment
            {
                clearColor: window.color
                antialiasingMode: SceneEnvironment.SSAA
                antialiasingQuality: SceneEnvironment.VeryHigh
            }
        }

        Label {
            text: "SSAA VeryHigh"
            anchors.top: parent.top
            anchors.right: parent.right
            anchors.margins: 10
            color: "#222840"
            font.pointSize: 14
        }
    }
}