summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/planets-qml/PlanetEffectDSB.qml
diff options
context:
space:
mode:
authorMika Salmela <mika.salmela@theqtcompany.com>2015-06-23 16:56:59 +0300
committerMika Salmela <mika.salmela@theqtcompany.com>2015-06-23 14:06:17 +0000
commit5cc86303d61264d98b51c7130dd36f50131a67ee (patch)
tree3032e743a383c56c49af1dcee109b772c06234e9 /examples/qt3d/planets-qml/PlanetEffectDSB.qml
parentdbe0950dfa2e6351af45a564e62b7a47ba6e7be2 (diff)
Add ES2 support to planets-qml example
Change-Id: Ic5208d2149efbd03b82417ce3af17747375663f5 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Diffstat (limited to 'examples/qt3d/planets-qml/PlanetEffectDSB.qml')
-rw-r--r--examples/qt3d/planets-qml/PlanetEffectDSB.qml73
1 files changed, 68 insertions, 5 deletions
diff --git a/examples/qt3d/planets-qml/PlanetEffectDSB.qml b/examples/qt3d/planets-qml/PlanetEffectDSB.qml
index 1b035406a..78b00bd32 100644
--- a/examples/qt3d/planets-qml/PlanetEffectDSB.qml
+++ b/examples/qt3d/planets-qml/PlanetEffectDSB.qml
@@ -36,7 +36,7 @@
****************************************************************************/
import Qt3D 2.0
-import Qt3D.Render 2.0
+import Qt3D.Renderer 2.0
Effect {
id: root
@@ -60,13 +60,15 @@ Effect {
minorVersion: 2
}
+ annotations: [ Annotation { name: "name"; value: "Desktop" } ]
+
renderPasses: [
RenderPass {
annotations: [ Annotation { name: "pass"; value: "shadowmap" } ]
shaderProgram: ShaderProgram {
- vertexShaderCode: loadSource("qrc:/shaders/shadowmap.vert")
- fragmentShaderCode: loadSource("qrc:/shaders/shadowmap.frag")
+ vertexShaderCode: loadSource("qrc:/shaders/gl3/shadowmap.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/gl3/shadowmap.frag")
}
renderStates: [
@@ -87,8 +89,69 @@ Effect {
]
shaderProgram: ShaderProgram {
- vertexShaderCode: loadSource("qrc:/shaders/planetDB.vert")
- fragmentShaderCode: loadSource("qrc:/shaders/planetDSB.frag")
+ vertexShaderCode: loadSource("qrc:/shaders/gl3/planetDB.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/gl3/planetDSB.frag")
+ }
+
+ // no special render state set => use the default set of states
+ }
+ ]
+ },
+ Technique {
+ openGLFilter {
+ api: OpenGLFilter.Desktop
+ majorVersion: 2
+ }
+
+ annotations: [ Annotation { name: "name"; value: "ES2" } ]
+
+ renderPasses: [
+ RenderPass {
+ annotations: [ Annotation { name : "pass"; value : "forward" } ]
+
+ bindings: [
+ // Uniforms (those provided by the user)
+ ParameterMapping {
+ parameterName: "ambient";
+ shaderVariableName: "ka";
+ bindingType: ParameterMapping.Uniform
+ }
+ ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/es2/planetDB.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/es2/planetDSB.frag")
+ }
+
+ // no special render state set => use the default set of states
+ }
+ ]
+ },
+ Technique {
+ openGLFilter {
+ api: OpenGLFilter.ES
+ majorVersion: 2
+ minorVersion: 0
+ }
+
+ annotations: [ Annotation { name: "name"; value: "ES2" } ]
+
+ renderPasses: [
+ RenderPass {
+ annotations: [ Annotation { name : "pass"; value : "forward" } ]
+
+ bindings: [
+ // Uniforms (those provided by the user)
+ ParameterMapping {
+ parameterName: "ambient";
+ shaderVariableName: "ka";
+ bindingType: ParameterMapping.Uniform
+ }
+ ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/es2/planetDB.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/es2/planetDSB.frag")
}
// no special render state set => use the default set of states