summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2017-01-25 12:10:33 +0100
committerKevin Ottens <kevin.ottens@kdab.com>2017-01-27 14:58:39 +0000
commitf5b66ed6706c129754a8fc0c0541eab1f9ed4181 (patch)
tree7cf7903abe9b817c24f34f3074c04e4e0c1f4da1 /examples
parent946e78eada359f651d337309b25d51d4204289b0 (diff)
Consolidate QML/C++ materials in extras
We remove the qml implementation of materials in extras that were also implemented in C++. Note this is an API change for the materials having texture properties. The QML ones had mistakenly a string property instead of a texture one. This move also fixes this API issue on the QML end. Change-Id: Ibed14288cd7b8c5ab9615b74b949c6a73ac29329 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qt3d/audio-visualizer-qml/Visualizer.qml8
-rw-r--r--examples/qt3d/lights/main.qml4
-rw-r--r--examples/qt3d/materials/Barrel.qml12
-rw-r--r--examples/qt3d/materials/Chest.qml2
-rw-r--r--examples/qt3d/materials/HousePlant.qml12
-rw-r--r--examples/qt3d/materials/main.qml6
6 files changed, 21 insertions, 23 deletions
diff --git a/examples/qt3d/audio-visualizer-qml/Visualizer.qml b/examples/qt3d/audio-visualizer-qml/Visualizer.qml
index 562d8c184..ce32dd3ee 100644
--- a/examples/qt3d/audio-visualizer-qml/Visualizer.qml
+++ b/examples/qt3d/audio-visualizer-qml/Visualizer.qml
@@ -189,8 +189,8 @@ Entity {
NormalDiffuseMapAlphaMaterial {
id: titlePlaneMaterial
- diffuse: "qrc:/images/demotitle.png"
- normal: "qrc:/images/normalmap.png"
+ diffuse: TextureLoader { source: "qrc:/images/demotitle.png" }
+ normal: TextureLoader { source: "qrc:/images/normalmap.png" }
shininess: 1.0
}
@@ -215,8 +215,8 @@ Entity {
}
property Material songPlaneMaterial: NormalDiffuseMapAlphaMaterial {
- diffuse: "qrc:/images/songtitle.png"
- normal: "qrc:/images/normalmap.png"
+ diffuse: TextureLoader { source: "qrc:/images/songtitle.png" }
+ normal: TextureLoader { source: "qrc:/images/normalmap.png" }
shininess: 1.0
}
diff --git a/examples/qt3d/lights/main.qml b/examples/qt3d/lights/main.qml
index 8f1c603cf..69250da13 100644
--- a/examples/qt3d/lights/main.qml
+++ b/examples/qt3d/lights/main.qml
@@ -183,8 +183,8 @@ Entity
material: NormalDiffuseMapMaterial {
ambient: Qt.rgba( 0.2, 0.2, 0.2, 1.0 )
- diffuse: "assets/textures/pattern_09/diffuse.webp"
- normal: "assets/textures/pattern_09/normal.webp"
+ diffuse: TextureLoader { source: "assets/textures/pattern_09/diffuse.webp" }
+ normal: TextureLoader { source: "assets/textures/pattern_09/normal.webp" }
textureScale: 10
shininess: 10
}
diff --git a/examples/qt3d/materials/Barrel.qml b/examples/qt3d/materials/Barrel.qml
index c68cab657..31abd329f 100644
--- a/examples/qt3d/materials/Barrel.qml
+++ b/examples/qt3d/materials/Barrel.qml
@@ -74,13 +74,11 @@ Entity {
material: NormalDiffuseSpecularMapMaterial {
id: material
ambient: "black"
- diffuse: "assets/metalbarrel/diffus_" + root.diffuseColor + ".webp"
- normal: "assets/metalbarrel/normal_" + root.bump + ".webp"
- specular: {
- if (root.specular !== "" )
- return "assets/metalbarrel/specular_" + root.specular + ".webp"
- else
- return "assets/metalbarrel/specular.webp"
+ diffuse: TextureLoader { source: "assets/metalbarrel/diffus_" + root.diffuseColor + ".webp" } //TextureLoader { source: ("assets/metalbarrel/diffus_" + root.diffuseColor + ".webp") }
+ normal: TextureLoader { source: "assets/metalbarrel/normal_" + root.bump + ".webp" }
+ specular: TextureLoader {
+ source: root.specular !== "" ? "assets/metalbarrel/specular_" + root.specular + ".webp"
+ : "assets/metalbarrel/specular.webp"
}
shininess: 5.0
diff --git a/examples/qt3d/materials/Chest.qml b/examples/qt3d/materials/Chest.qml
index 879ebb26f..227e32864 100644
--- a/examples/qt3d/materials/Chest.qml
+++ b/examples/qt3d/materials/Chest.qml
@@ -68,7 +68,7 @@ Entity {
material: DiffuseMapMaterial {
id: material
- diffuse: "assets/chest/diffuse.webp"
+ diffuse: TextureLoader { source: "assets/chest/diffuse.webp" }
specular: Qt.rgba( 0.2, 0.2, 0.2, 1.0 )
shininess: 2.0
}
diff --git a/examples/qt3d/materials/HousePlant.qml b/examples/qt3d/materials/HousePlant.qml
index 6505ab171..7ee810d7f 100644
--- a/examples/qt3d/materials/HousePlant.qml
+++ b/examples/qt3d/materials/HousePlant.qml
@@ -70,8 +70,8 @@ Entity {
position: Qt.vector3d(root.x, root.y, root.z)
material: NormalDiffuseMapMaterial {
- diffuse: "assets/houseplants/pot.webp"
- normal: "assets/houseplants/pot_normal.webp"
+ diffuse: TextureLoader { source: "assets/houseplants/pot.webp" }
+ normal: TextureLoader { source: "assets/houseplants/pot_normal.webp" }
specular: Qt.rgba( 0.75, 0.75, 0.75, 1.0 )
shininess: 5.0
}
@@ -79,8 +79,8 @@ Entity {
RenderableEntity {
source: "assets/houseplants/" + root.potShape + "-" + root.plantType + ".obj"
material: NormalDiffuseMapAlphaMaterial {
- diffuse: "assets/houseplants/" + root.plantType + ".webp"
- normal: "assets/houseplants/" + root.plantType + "_normal.webp"
+ diffuse: TextureLoader { source: "assets/houseplants/" + root.plantType + ".webp" }
+ normal: TextureLoader { source: "assets/houseplants/" + root.plantType + "_normal.webp" }
shininess: 10.0
}
}
@@ -88,8 +88,8 @@ Entity {
RenderableEntity {
source: "assets/houseplants/" + root.potShape + "-pot-cover.obj"
material: NormalDiffuseMapMaterial {
- diffuse: "assets/houseplants/cover.webp"
- normal: "assets/houseplants/cover_normal.webp"
+ diffuse: TextureLoader { source: "assets/houseplants/cover.webp" }
+ normal: TextureLoader { source: "assets/houseplants/cover_normal.webp" }
specular: Qt.rgba( 0.05, 0.05, 0.05, 1.0 )
shininess: 5.0
}
diff --git a/examples/qt3d/materials/main.qml b/examples/qt3d/materials/main.qml
index 9ed9bd219..c09454065 100644
--- a/examples/qt3d/materials/main.qml
+++ b/examples/qt3d/materials/main.qml
@@ -96,9 +96,9 @@ Entity {
material: NormalDiffuseSpecularMapMaterial {
ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 )
- diffuse: "assets/textures/pattern_09/diffuse.webp"
- specular: "assets/textures/pattern_09/specular.webp"
- normal: "assets/textures/pattern_09/normal.webp"
+ diffuse: TextureLoader { source: "assets/textures/pattern_09/diffuse.webp" }
+ specular: TextureLoader { source: "assets/textures/pattern_09/specular.webp" }
+ normal: TextureLoader { source: "assets/textures/pattern_09/normal.webp" }
textureScale: 10.0
shininess: 10.0
}