diff options
author | Tomi Korpipää <tomi.korpipaa@theqtcompany.com> | 2016-05-20 10:18:23 +0300 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-06-03 06:26:28 +0000 |
commit | edc5b80b4e9bcd1d494c4dc92aff8316238ed8b8 (patch) | |
tree | fd164d6323a53e98a29c5dccd16294b1ca0dd80d /examples/qt3d/planets-qml/PlanetMaterial.qml | |
parent | a398469e66e3a953097857c60655c41bf291a06b (diff) |
Fixed sun in planets-qml
Also removed duplicate code and made some rearrangements in entities.
Change-Id: I7f588672a1694fc440318f66bcfbe33d5ebcf0ab
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/planets-qml/PlanetMaterial.qml')
-rw-r--r-- | examples/qt3d/planets-qml/PlanetMaterial.qml | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/examples/qt3d/planets-qml/PlanetMaterial.qml b/examples/qt3d/planets-qml/PlanetMaterial.qml index ca0fa5405..4d50aee8d 100644 --- a/examples/qt3d/planets-qml/PlanetMaterial.qml +++ b/examples/qt3d/planets-qml/PlanetMaterial.qml @@ -59,9 +59,9 @@ Material { property color diffuseColor: Qt.rgba(0.7, 0.7, 0.7, 1.0) property color specularColor: Qt.rgba(0.5, 0.5, 0.5, 1.0) property real shininess: 150.0 - property alias diffuseMap: diffuseTextureImage.source - property alias specularMap: specularTextureImage.source - property alias normalMap: normalTextureImage.source + property string diffuseMap + property string specularMap + property string normalMap property real textureScale: 1.0 property real opacity: 1.0 @@ -94,7 +94,10 @@ Material { } generateMipMaps: true maximumAnisotropy: 16.0 - TextureImage { id: diffuseTextureImage } + TextureImage { + id: diffuseTextureImage + source: diffuseMap + } } }, Parameter { @@ -109,7 +112,11 @@ Material { } generateMipMaps: true maximumAnisotropy: 16.0 - TextureImage { id: specularTextureImage } + TextureImage { + id: specularTextureImage + // Get rid of runtime warnings. It's safe, as the texture just isn't used + source: specularMap !== "" ? specularMap : "qrc:/images/uranusmap.jpg" + } } }, Parameter { @@ -123,7 +130,11 @@ Material { y: WrapMode.Repeat } maximumAnisotropy: 16.0 - TextureImage { id: normalTextureImage } + TextureImage { + id: normalTextureImage + // Get rid of runtime warnings. It's safe, as the texture just isn't used + source: normalMap !== "" ? normalMap : "qrc:/images/uranusmap.jpg" + } } }, Parameter { |