| 1 |
// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
import Qt3D.Core 2.0 |
| 5 |
import Qt3D.Render 2.0 |
| 6 |
import Qt3D.Extras 2.0 |
| 7 |
|
| 8 |
Entity { |
| 9 |
readonly property Layer layer: debugLayer |
| 10 |
|
| 11 |
components : [ |
| 12 |
Layer { id: debugLayer }, |
| 13 |
|
| 14 |
PlaneMesh { |
| 15 |
width: 2.0 |
| 16 |
height: 2.0 |
| 17 |
meshResolution: Qt.size(2, 2) |
| 18 |
}, |
| 19 |
|
| 20 |
Transform { // We rotate the plane so that it faces us |
| 21 |
rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 90) |
| 22 |
}, |
| 23 |
|
| 24 |
Material { |
| 25 |
effect : Effect { |
| 26 |
techniques: [ |
| 27 |
Technique { |
| 28 |
graphicsApiFilter {api : GraphicsApiFilter.OpenGL; profile : GraphicsApiFilter.NoProfile; minorVersion : 0; majorVersion : 2 } |
| 29 |
renderPasses: RenderPass { |
| 30 |
filterKeys: FilterKey { name: "pass"; value: "final" } |
| 31 |
shaderProgram: ShaderProgram { |
| 32 |
vertexShaderCode: loadSource("qrc:/debug_es2.vert") |
| 33 |
fragmentShaderCode: loadSource("qrc:/debug_es2.frag") |
| 34 |
} |
| 35 |
} |
| 36 |
}, |
| 37 |
Technique { |
| 38 |
graphicsApiFilter {api : GraphicsApiFilter.OpenGL; profile : GraphicsApiFilter.CoreProfile; minorVersion : 2; majorVersion : 3 } |
| 39 |
renderPasses: RenderPass { |
| 40 |
filterKeys: FilterKey { name: "pass"; value: "final" } |
| 41 |
shaderProgram: ShaderProgram { |
| 42 |
vertexShaderCode: loadSource("qrc:/debug_gl3.vert") |
| 43 |
fragmentShaderCode: loadSource("qrc:/debug_gl3.frag") |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
] |
| 48 |
} |
| 49 |
} |
| 50 |
] |
| 51 |
} |