summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/lights
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-12-09 16:21:04 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-12-10 11:54:28 +0000
commit5e94c15ddc89779c6da7ae919985688173a4d20d (patch)
treee9efeba287fab6c234d6e6ab1b3274478e7092d8 /examples/qt3d/lights
parent2dec7715ed977e5cafdd35543538e104e1ccadf9 (diff)
Do lighting calculation in world space
As opposed to (mostly) camera space. Oops. While somewhat hidden with point lights, the problem became apparent with directional lights. Now that we have proper directional lights, change the default light, that is used when no light components are specified at all, from point to directional since this is cheaper and provides less surprises with arbitrary scenes. Also remove the duplicate phongalpha vertex shader in the process. Change-Id: I295660a1400b16b69e1516672e31794312ee48d1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/lights')
-rw-r--r--examples/qt3d/lights/main.qml5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/qt3d/lights/main.qml b/examples/qt3d/lights/main.qml
index 85af9b6cd..7f103002f 100644
--- a/examples/qt3d/lights/main.qml
+++ b/examples/qt3d/lights/main.qml
@@ -67,7 +67,7 @@ Entity
id: sun
components: [
DirectionalLight {
- color: Qt.rgba(0.9, 0.9, 0.0, 1.0)
+ color: Qt.rgba(0.8, 0.8, 0.8, 1.0)
direction: Qt.vector3d(-1, -1, 0)
}
]
@@ -155,6 +155,9 @@ Entity
Entity {
components: [
+ PhongMaterial {
+ diffuse: "white"
+ },
Mesh {
source: "assets/obj/toyplane.obj"
}