summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2017-11-15 11:45:42 +0100
committerSean Harmer <sean.harmer@kdab.com>2017-11-15 10:51:28 +0000
commit100cc447253e84a3dc7df2a140731d7c85863780 (patch)
tree53d25d6072e33b574a2eff1c15da123527886b84 /examples
parent57dc68b56858a1f9892319e8789169b2953c4c6e (diff)
Replace all phong variants with QDiffuseSpecularMaterial
This one reconfigures its graph layers and render states properly based on it properties. As such it covers all the features coming from the various phong materials we had in the past. That's why they are all marked as deprecated. Change-Id: I9a74639d4cff5170b496d475c8a74b1e4e163b03 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qt3d/phong-cubes/main.qml25
1 files changed, 15 insertions, 10 deletions
diff --git a/examples/qt3d/phong-cubes/main.qml b/examples/qt3d/phong-cubes/main.qml
index 0e067fdad..311e65a63 100644
--- a/examples/qt3d/phong-cubes/main.qml
+++ b/examples/qt3d/phong-cubes/main.qml
@@ -51,7 +51,8 @@
import Qt3D.Core 2.0
import Qt3D.Render 2.0
import Qt3D.Input 2.0
-import Qt3D.Extras 2.0
+import Qt3D.Extras 2.10
+import QtQuick 2.0
Entity {
components: [
@@ -84,19 +85,19 @@ Entity {
CubeEntity {
position: Qt.vector3d(-1, 1, 0)
- material: PhongMaterial {}
+ material: DiffuseSpecularMaterial {}
}
CubeEntity {
position: Qt.vector3d(0, 1, 0)
- material: DiffuseMapMaterial {
+ material: DiffuseSpecularMaterial {
diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" }
}
}
CubeEntity {
position: Qt.vector3d(1, 1, 0)
- material: DiffuseSpecularMapMaterial {
+ material: DiffuseSpecularMaterial {
diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" }
specular: TextureLoader { source: "qrc:/assets/textures/pattern_09/specular.webp" }
}
@@ -104,12 +105,15 @@ Entity {
CubeEntity {
position: Qt.vector3d(-1, 0, 0)
- material: PhongAlphaMaterial {}
+ material: DiffuseSpecularMaterial {
+ alphaBlending: true
+ diffuse: Qt.rgba(0.7, 0.7, 0.7, 0.5)
+ }
}
CubeEntity {
position: Qt.vector3d(0, 0, 0)
- material: NormalDiffuseMapMaterial {
+ material: DiffuseSpecularMaterial {
normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" }
diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" }
}
@@ -117,7 +121,8 @@ Entity {
CubeEntity {
position: Qt.vector3d(1, 0, 0)
- material: NormalDiffuseMapAlphaMaterial {
+ material: DiffuseSpecularMaterial {
+ alphaBlending: true
normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" }
diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" }
}
@@ -125,7 +130,7 @@ Entity {
CubeEntity {
position: Qt.vector3d(-1, -1, 0)
- material: NormalDiffuseSpecularMapMaterial {
+ material: DiffuseSpecularMaterial {
normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" }
diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" }
specular: TextureLoader { source: "qrc:/assets/textures/pattern_09/specular.webp" }
@@ -134,7 +139,7 @@ Entity {
CubeEntity {
position: Qt.vector3d(0, -1, 0)
- material: NormalDiffuseSpecularMapMaterial {
+ material: DiffuseSpecularMaterial {
normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" }
diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" }
specular: TextureLoader { source: "qrc:/assets/textures/pattern_09/specular.webp" }
@@ -143,7 +148,7 @@ Entity {
CubeEntity {
position: Qt.vector3d(1, -1, 0)
- material: NormalDiffuseSpecularMapMaterial {
+ material: DiffuseSpecularMaterial {
normal: TextureLoader { source: "qrc:/assets/textures/pattern_09/normal.webp" }
diffuse: TextureLoader { source: "qrc:/assets/textures/pattern_09/diffuse.webp" }
specular: TextureLoader { source: "qrc:/assets/textures/pattern_09/specular.webp" }