From 100cc447253e84a3dc7df2a140731d7c85863780 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Wed, 15 Nov 2017 11:45:42 +0100 Subject: 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 --- examples/qt3d/phong-cubes/main.qml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'examples') 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" } -- cgit v1.2.3