File: customTexturesShared.qml

package info (click to toggle)
qt6-quick3d 6.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 143,588 kB
  • sloc: cpp: 395,989; ansic: 41,469; xml: 288; sh: 242; makefile: 32
file content (65 lines) | stat: -rw-r--r-- 1,148 bytes parent folder | download | duplicates (4)
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
import QtQuick
import QtQuick3D
import io.qt.tests.auto.BufferManager

View3D {
    width: 640
    height: 480
    id: view1
    anchors.fill: parent

    PerspectiveCamera {
        id: camera1
    }

    Texture {
        id: tex1
        textureData: GradientTexture {
            id: textData1
            width: 256
            height: 256
            startColor: "red"
            endColor: "blue"
        }
    }

    GradientTexture {
        id: textData2
        width: 128
        height: 128
        startColor: "green"
        endColor: "yellow"
    }

    Texture {
        id: tex3
        textureData: textData2
    }

    Model {
        id: model1
        source: "#Cube"
        materials: PrincipledMaterial {
            baseColorMap: tex1
        }
    }

    Model {
        id: model2
        source: "#Cube"
        materials: PrincipledMaterial {
            baseColorMap: Texture {
                id: tex2
                textureData: textData1
            }
        }
    }

    Model {
        id: model3
        source: "#Cube"
        materials: PrincipledMaterial {
            baseColorMap: tex3
        }
    }
}