diff options
author | Paul Lemire <paul.lemire.ecortex@kdab.com> | 2014-12-29 16:10:48 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-12-31 11:23:49 +0100 |
commit | bee25daf9efaa688a6954a5b31a07c51db49b8ba (patch) | |
tree | 5bc3f2982689c8908c9fbe440eff36cd1d15f6a1 /examples/materials | |
parent | 2be97a74b23c66d385b1dd89df106c9be7be7696 (diff) |
Default cpp materials + material-cpp example
QDiffuseMapMaterial
QDiffuseSpecularMapMaterial
QNormalDiffuseMapMaterial
QNormalDiffuseAlphaMapMaterial
QNormalDiffuseSpecularMapMaterial
material-cpp is mostly inspired from materials (QML) but nicer :).
Note: there seems to be an issue with qrc and QUrl. The behavior is different
between QML and C++.
-In C++ we need to prefix with have qrc:/ and convert that to :/ (passing :/
directly returns "" when QUrl toString is called)
-From QML no prefix is needed.
-For QImage path, :/ should be used.
Change-Id: Ib56fb9546c95c2872686a46ed048a290ab4a5b6f
Task-number: QTBUG-41548
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/materials')
-rw-r--r-- | examples/materials/Barrel.qml | 2 | ||||
-rw-r--r-- | examples/materials/Chest.qml | 2 | ||||
-rw-r--r-- | examples/materials/HousePlant.qml | 6 | ||||
-rw-r--r-- | examples/materials/TrefoilKnot.qml | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/examples/materials/Barrel.qml b/examples/materials/Barrel.qml index 8545f1f07..a31f6f595 100644 --- a/examples/materials/Barrel.qml +++ b/examples/materials/Barrel.qml @@ -59,7 +59,7 @@ Entity { RenderableEntity { id: barrel - source: ":/assets/metalbarrel/metal_barrel.obj" + source: "assets/metalbarrel/metal_barrel.obj" scale: 0.03 material: NormalDiffuseSpecularMapMaterial { diff --git a/examples/materials/Chest.qml b/examples/materials/Chest.qml index b01754be6..0d2813fd4 100644 --- a/examples/materials/Chest.qml +++ b/examples/materials/Chest.qml @@ -54,7 +54,7 @@ Entity { RenderableEntity { id: chest - source: ":/assets/chest/Chest.obj" + source: "assets/chest/Chest.obj" scale: 0.03 material: DiffuseMapMaterial { diff --git a/examples/materials/HousePlant.qml b/examples/materials/HousePlant.qml index 704749820..6e5d39c7e 100644 --- a/examples/materials/HousePlant.qml +++ b/examples/materials/HousePlant.qml @@ -58,7 +58,7 @@ Entity { RenderableEntity { id: pot - source: ":/assets/houseplants/" + root.potShape + "-pot.obj" + source: "assets/houseplants/" + root.potShape + "-pot.obj" scale: 0.03 material: NormalDiffuseMapMaterial { @@ -70,7 +70,7 @@ Entity { } RenderableEntity { - source: ":/assets/houseplants/" + root.potShape + "-" + root.plantType + ".obj" + source: "assets/houseplants/" + root.potShape + "-" + root.plantType + ".obj" material: NormalDiffuseMapMaterial { effect: root.normalDiffuseMapAlphaEffect diffuse: "assets/houseplants/" + root.plantType + ".webp" @@ -80,7 +80,7 @@ Entity { } RenderableEntity { - source: ":/assets/houseplants/" + root.potShape + "-pot-cover.obj" + source: "assets/houseplants/" + root.potShape + "-pot-cover.obj" material: NormalDiffuseMapMaterial { effect: root.normalDiffuseMapEffect diffuse: "assets/houseplants/cover.webp" diff --git a/examples/materials/TrefoilKnot.qml b/examples/materials/TrefoilKnot.qml index 42367099b..71e9ec11f 100644 --- a/examples/materials/TrefoilKnot.qml +++ b/examples/materials/TrefoilKnot.qml @@ -65,6 +65,6 @@ Entity { Mesh { id: mesh - source: ":/assets/obj/trefoil.obj" + source: "assets/obj/trefoil.obj" } } |