aboutsummaryrefslogtreecommitdiffstats
path: root/tests/baseline/data/shadows/DirectionallightCube.qml
blob: 213cdfbab7fabf0d4eb0936c1feba73a4b5c659a (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
import QtQuick
import QtQuick3D
import QtQuick3D.Helpers

Item {
    id: mainWindow
    width: 400
    height: 400
    visible: true

    View3D {
        anchors.fill: parent
        camera: camera

        environment: SceneEnvironment {
            clearColor: "#404040"
            backgroundMode: SceneEnvironment.Color
        }

        PerspectiveCamera {
            id: camera
            position: Qt.vector3d(0, 0, 150)
            clipFar: 2000
        }

        DirectionalLight {
            brightness: 50
            eulerRotation: Qt.vector3d(-90, -90, 0)
            castsShadow: true
            shadowFactor: 25
            shadowMapQuality: Light.ShadowMapQualityHigh
        }

        Model {
            source: "#Rectangle"
            eulerRotation: Qt.vector3d(-90, 0, 0)
            y: -30
            scale: Qt.vector3d(3, 3, 1)
            receivesShadows: true
            materials: [
                DefaultMaterial {
                    diffuseColor: "#0c100c"
                }
            ]
        }

        Model
        {
            source: "#Cube"
            castsShadows: true
            receivesShadows: false
            position: Qt.vector3d(1, 1, 0)
            scale: Qt.vector3d(0.1, 0.1, 0.1)
            materials: [
                DefaultMaterial {
                    diffuseColor: Qt.rgba(1.0, 0.9, 0.7, 1.0)
                }
            ]
        }
    }
}