diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-07-09 15:46:18 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-07-12 19:15:37 +0000 |
commit | 2bdc7cb6b1a8acea1bf04ed18f4ab04f64c7e834 (patch) | |
tree | de48bbef463f6cec6f1265f878a7cb5b5eb39a3a /examples/qt3d/materials/main.qml | |
parent | ac277ebc028039eb3811d9e51dcbb643919ed3fc (diff) |
Add some more interesting lighting to the materials example
Useful for testing more of the lighting shader code paths.
Change-Id: Iae1403bbe8562cfc8a0d22784069080a421153f5
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/materials/main.qml')
-rw-r--r-- | examples/qt3d/materials/main.qml | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/examples/qt3d/materials/main.qml b/examples/qt3d/materials/main.qml index 46a48c4e2..9ed9bd219 100644 --- a/examples/qt3d/materials/main.qml +++ b/examples/qt3d/materials/main.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 as QQ2 +import QtQuick 2.1 import Qt3D.Core 2.0 import Qt3D.Render 2.0 import Qt3D.Input 2.0 @@ -79,9 +79,11 @@ Entity { FirstPersonCameraController { camera: mainCamera } + Lights { } + PhongMaterial { id: redAdsMaterial - ambient: Qt.rgba( 0.2, 0.0, 0.0, 1.0 ) + ambient: Qt.rgba( 0.02, 0.02, 0.02, 1.0 ) diffuse: Qt.rgba( 0.8, 0.0, 0.0, 1.0 ) } @@ -93,12 +95,12 @@ Entity { resolution: Qt.size(20, 20) material: NormalDiffuseSpecularMapMaterial { - ambient: Qt.rgba( 0.2, 0.2, 0.2, 1.0 ) + 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" textureScale: 10.0 - shininess: 80.0 + shininess: 10.0 } } @@ -108,18 +110,18 @@ Entity { y: 3.5 scale: 0.5 - QQ2.ParallelAnimation { - loops: QQ2.Animation.Infinite + ParallelAnimation { + loops: Animation.Infinite running: true - QQ2.NumberAnimation { + NumberAnimation { target: trefoilKnot property: "theta" from: 0; to: 360 duration: 2000 } - QQ2.NumberAnimation { + NumberAnimation { target: trefoilKnot property: "phi" from: 0; to: 360 @@ -198,6 +200,6 @@ Entity { diffuseColor: "stainless_steel" bump: "no_bumps" specular: "stainless_steel" - shininess: 150 + shininess: 15 } } |