diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-11-16 10:36:08 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-11-17 13:31:06 +0000 |
commit | b58719b2222fd3b3527758aaf482b1635af7857c (patch) | |
tree | 927b49f84eeb5ed161ec53e909a2649994870a6c /examples/qt3d | |
parent | 0a9b2bd2d7152969110e9e37753e336fb418f8da (diff) |
Fix controls example to look better
Phong lighting now takes alpha into account to set this to 1.
Also add an explicit point light and properly use ambient and diffuse
components.
Change-Id: I252004c1a22bc3f43a527f79feef310b23279863
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d')
-rw-r--r-- | examples/qt3d/controls/Logo.qml | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/examples/qt3d/controls/Logo.qml b/examples/qt3d/controls/Logo.qml index 2eb9abd1a..62742246f 100644 --- a/examples/qt3d/controls/Logo.qml +++ b/examples/qt3d/controls/Logo.qml @@ -91,8 +91,8 @@ Entity { PhongMaterial { id: material - ambient: Qt.rgba( color_r.value/255, color_g.value/255, color_b.value/255, 1.0 ) - diffuse: Qt.rgba( 0.1, 0.1, 0.1, 0.5 ) + diffuse: Qt.rgba( color_r.value/255, color_g.value/255, color_b.value/255, 1.0 ) + ambient: Qt.rgba( 0.1, 0.1, 0.1, 1.0 ) shininess: shining.value } @@ -110,4 +110,16 @@ Entity { id: logoEntity components: [ logoMesh, material, logoTransform ] } + + Entity { + components: [ + PointLight { + color: "white" + intensity: 0.6 + }, + Transform { + translation: Qt.vector3d(0, 0, 10) + } + ] + } } |