From bee25daf9efaa688a6954a5b31a07c51db49b8ba Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Mon, 29 Dec 2014 16:10:48 +0100 Subject: 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 --- examples/materials/Barrel.qml | 2 +- examples/materials/Chest.qml | 2 +- examples/materials/HousePlant.qml | 6 +++--- examples/materials/TrefoilKnot.qml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'examples/materials') 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" } } -- cgit v1.2.3