| 1 |
// Copyright (C) 2015 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 |
components: RenderSettings { |
| 10 |
ForwardRenderer {} |
| 11 |
renderPolicy: RenderSettings.Always |
| 12 |
} |
| 13 |
|
| 14 |
Entity { |
| 15 |
components: [ |
| 16 |
PlaneMesh { |
| 17 |
width: 2.0 |
| 18 |
height: 2.0 |
| 19 |
meshResolution: Qt.size(2, 2) |
| 20 |
}, |
| 21 |
|
| 22 |
Transform { // Rotate the plane so that it faces us |
| 23 |
rotation: fromAxisAndAngle(Qt.vector3d(1.0, 0.0, 0.0), 90) |
| 24 |
}, |
| 25 |
|
| 26 |
Material { |
| 27 |
parameters: Parameter { name: "winsize"; value: Qt.vector2d(_window.width, _window.height) } |
| 28 |
|
| 29 |
effect: Effect { |
| 30 |
techniques: Technique { |
| 31 |
filterKeys: [ FilterKey{ name: "renderingStyle"; value: "forward" } ] |
| 32 |
|
| 33 |
graphicsApiFilter { |
| 34 |
minorVersion: 3 |
| 35 |
majorVersion: 2 |
| 36 |
api: GraphicsApiFilter.OpenGL |
| 37 |
profile: GraphicsApiFilter.CoreProfile |
| 38 |
} |
| 39 |
|
| 40 |
renderPasses: RenderPass { |
| 41 |
shaderProgram: ShaderProgram { |
| 42 |
vertexShaderCode: loadSource("qrc:/plasma.vert") |
| 43 |
fragmentShaderCode: loadSource("qrc:/plasma.frag") |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
} |
| 48 |
} |
| 49 |
] |
| 50 |
} |
| 51 |
} |