diff options
author | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-09-17 12:22:23 +0300 |
---|---|---|
committer | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-09-19 12:46:07 +0300 |
commit | 814d037a67c827a5eef0f3d166d5ada498f408fb (patch) | |
tree | aaebc2179e5e95f2c8863dc72630748470829e19 /src/runtime | |
parent | 9395963fdef3030136c242dc27bbd5e17566f054 (diff) |
Add transparency mode selection to standard materials
ASTC textures would need to be decompressed upon loading to scan for
transparency, or the texture files would need their own user-defined
settings to enable transparency. Instead, as a work-around, materials
can be forced to be treated as transparent without manipulating opacity.
This is implemented with a transparency mode drop down list containing
"Default", "Force Transparent" and "Force Opaque" options. "Force
Opaque" can be used to force the material to be treated as opaque even
when the textures used are transparent.
By default ASTC textures are treated as non-transparent.
Task-number: QT3DS-3904
Change-Id: I22255ffb2e2be5efea3e56466d58ddcc46490bb2
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Janne Kangas <janne.kangas@qt.io>
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Diffstat (limited to 'src/runtime')
-rw-r--r-- | src/runtime/Qt3DSAttributeHashes.cpp | 1 | ||||
-rw-r--r-- | src/runtime/Qt3DSAttributeHashes.h | 1 | ||||
-rw-r--r-- | src/runtime/Qt3DSAttributeHashes.txt | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/Qt3DSAttributeHashes.cpp b/src/runtime/Qt3DSAttributeHashes.cpp index 4e320df..9d248b7 100644 --- a/src/runtime/Qt3DSAttributeHashes.cpp +++ b/src/runtime/Qt3DSAttributeHashes.cpp @@ -165,6 +165,7 @@ const char *GetAttributeString(const EAttribute inAttribute) case ATTRIBUTE_DIFFUSELIGHTWRAP: return "diffuselightwrap"; case ATTRIBUTE_REFERENCEDMATERIAL: return "referencedmaterial"; case ATTRIBUTE_VERTEXCOLORS: return "vertexcolors"; + case ATTRIBUTE_TRANSPARENCYMODE: return "transparencymode"; case ATTRIBUTE_ROTATIONUV: return "rotationuv"; case ATTRIBUTE_POSITIONU: return "positionu"; case ATTRIBUTE_POSITIONV: return "positionv"; diff --git a/src/runtime/Qt3DSAttributeHashes.h b/src/runtime/Qt3DSAttributeHashes.h index a1cd41f..3f53541 100644 --- a/src/runtime/Qt3DSAttributeHashes.h +++ b/src/runtime/Qt3DSAttributeHashes.h @@ -156,6 +156,7 @@ enum EAttribute { ATTRIBUTE_DIFFUSELIGHTWRAP = 0x038F6522, // diffuselightwrap ATTRIBUTE_REFERENCEDMATERIAL = 0x035FDA80, // referencedmaterial ATTRIBUTE_VERTEXCOLORS = 0x000814EC, // vertexcolors + ATTRIBUTE_TRANSPARENCYMODE = 0x02E77D05, // transparencymode ATTRIBUTE_ROTATIONUV = 0x012E3A61, // rotationuv ATTRIBUTE_POSITIONU = 0x01D05AB4, // positionu ATTRIBUTE_POSITIONV = 0x01D15AF3, // positionv diff --git a/src/runtime/Qt3DSAttributeHashes.txt b/src/runtime/Qt3DSAttributeHashes.txt index 0cc3e07..b8e2a7f 100644 --- a/src/runtime/Qt3DSAttributeHashes.txt +++ b/src/runtime/Qt3DSAttributeHashes.txt @@ -120,6 +120,7 @@ translucentfalloff diffuselightwrap referencedmaterial vertexcolors +transparencymode rotationuv positionu |