Skip to content

Commit

Permalink
archrelease: copy trunk to staging-x86_64
Browse files Browse the repository at this point in the history
git-svn-id: file:///srv/repos/svn-packages/svn@436356 eb2447ed-0c53-47e4-bac8-5bc4a241df78
  • Loading branch information
antonio-rojas committed Feb 6, 2022
1 parent 9a42d63 commit 5152b07
Show file tree
Hide file tree
Showing 2 changed files with 175 additions and 0 deletions.
38 changes: 38 additions & 0 deletions qt6-quick3d/repos/staging-x86_64/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: Antonio Rojas <[email protected]>
# Maintainer: Felix Yan <[email protected]>
# Contributor: Andrea Scarpino <[email protected]>

pkgname=qt6-quick3d
_qtver=6.2.3
pkgver=${_qtver/-/}
pkgrel=3
arch=(x86_64)
url='https://www.qt.io'
license=(GPL3)
pkgdesc='Qt module and API for defining 3D content in Qt Quick'
depends=(qt6-quicktimeline)
makedepends=(cmake ninja qt6-shadertools assimp)
optdepends=('qt6-shadertools: for shadergen' 'assimp: assimp import plugin')
groups=(qt6)
options=(debug)
_pkgfn="${pkgname/6-/}-everywhere-src-$_qtver"
source=(https://download.qt.io/official_releases/qt/${pkgver%.*}/$_qtver/submodules/$_pkgfn.tar.xz
qt6-quick3d-assimp-5.1.patch)
sha256sums=('c45294f917232320a2cf67ee25b518f6ff3cdf989b8cecfb2ed73569ab28661e'
'49eb8feec3fdd1972266cf97fd8d40f0eb7e544c1957569c4b9f182348b17492')

prepare() {
patch -d $_pkgfn -p1 < qt6-quick3d-assimp-5.1.patch # Fix build with assimp 5.1
}

build() {
cmake -B build -S $_pkgfn -G Ninja
cmake --build build
}

package() {
DESTDIR="$pkgdir" cmake --install build

install -d "$pkgdir"/usr/share/licenses
ln -s /usr/share/licenses/qt6-base "$pkgdir"/usr/share/licenses/$pkgname
}
137 changes: 137 additions & 0 deletions qt6-quick3d/repos/staging-x86_64/qt6-quick3d-assimp-5.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
diff --git a/src/plugins/assetimporters/assimp/assimpimporter.cpp b/src/plugins/assetimporters/assimp/assimpimporter.cpp
index cb8f92a3..4ce57d64 100644
--- a/src/plugins/assetimporters/assimp/assimpimporter.cpp
+++ b/src/plugins/assetimporters/assimp/assimpimporter.cpp
@@ -1268,7 +1268,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
// GLTF Mode
{
aiColor4D baseColorFactor;
- result = material->Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_FACTOR, baseColorFactor);
+ result = material->Get(AI_MATKEY_BASE_COLOR, baseColorFactor);
if (result == aiReturn_SUCCESS)
QSSGQmlUtilities::writeQmlPropertyHelper(output,
tabLevel + 1,
@@ -1276,7 +1276,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
QStringLiteral("baseColor"),
aiColorToQColor(baseColorFactor));

- QString baseColorImage = generateImage(material, AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_TEXTURE, tabLevel + 1);
+ QString baseColorImage = generateImage(material, aiTextureType_BASE_COLOR, 0, tabLevel + 1);
if (!baseColorImage.isNull()) {
output << QSSGQmlUtilities::insertTabs(tabLevel + 1) << QStringLiteral("baseColorMap: ") << baseColorImage << QStringLiteral("\n");
output << QSSGQmlUtilities::insertTabs(tabLevel + 1) << QStringLiteral("opacityChannel: Material.A\n");
@@ -1294,7 +1294,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
}

ai_real metallicFactor;
- result = material->Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLIC_FACTOR, metallicFactor);
+ result = material->Get(AI_MATKEY_METALLIC_FACTOR, metallicFactor);
if (result == aiReturn_SUCCESS) {
QSSGQmlUtilities::writeQmlPropertyHelper(output,
tabLevel + 1,
@@ -1304,7 +1304,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
}

ai_real roughnessFactor;
- result = material->Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_ROUGHNESS_FACTOR, roughnessFactor);
+ result = material->Get(AI_MATKEY_ROUGHNESS_FACTOR, roughnessFactor);
if (result == aiReturn_SUCCESS) {
QSSGQmlUtilities::writeQmlPropertyHelper(output,
tabLevel + 1,
@@ -1410,16 +1410,14 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
}

{
- bool isUnlit;
- result = material->Get(AI_MATKEY_GLTF_UNLIT, isUnlit);
- if (result == aiReturn_SUCCESS && isUnlit)
+ aiShadingMode shadingMode;
+ material->Get(AI_MATKEY_SHADING_MODEL, shadingMode);
+ if (shadingMode == aiShadingMode_Unlit)
output << QSSGQmlUtilities::insertTabs(tabLevel + 1) << QStringLiteral("lighting: PrincipledMaterial.NoLighting\n");
}

// SpecularGlossiness Properties
- bool hasSpecularGlossiness;
- result = material->Get(AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS, hasSpecularGlossiness);
- if (result == aiReturn_SUCCESS && hasSpecularGlossiness) {
+ {

// diffuseFactor (color) // not used (yet), but ends up being diffuseColor
// {
@@ -1448,7 +1446,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
// glossinessFactor (float)
{
ai_real glossiness;
- result = material->Get(AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_GLOSSINESS_FACTOR, glossiness);
+ result = material->Get(AI_MATKEY_GLOSSINESS_FACTOR, glossiness);
if (result == aiReturn_SUCCESS)
QSSGQmlUtilities::writeQmlPropertyHelper(output,
tabLevel + 1,
@@ -1560,7 +1558,7 @@ QString AssimpImporter::generateImage(aiMaterial *material, aiTextureType textur

if (m_gltfMode) {
uint gltfUvIndex = 0;
- result = material->Get(AI_MATKEY_GLTF_TEXTURE_TEXCOORD(textureType, index), gltfUvIndex);
+ result = material->Get(AI_MATKEY_UVWSRC(textureType, index), gltfUvIndex);
if (result == aiReturn_SUCCESS)
uvIndex = gltfUvIndex;
}
diff --git a/src/plugins/assetimporters/assimp/assimpimporter_rt.cpp b/src/plugins/assetimporters/assimp/assimpimporter_rt.cpp
index c3c77d7e..90aee0c5 100644
--- a/src/plugins/assetimporters/assimp/assimpimporter_rt.cpp
+++ b/src/plugins/assetimporters/assimp/assimpimporter_rt.cpp
@@ -344,7 +344,7 @@ static void setMaterialProperties(QSSGSceneDesc::Material &target, const aiMater
texInfo.transform = &transform;

if (sceneInfo.ver == SceneInfo::GltfVersion::v2) {
- material.Get(AI_MATKEY_GLTF_TEXTURE_TEXCOORD(textureType, index), texInfo.uvIndex);
+ material.Get(AI_MATKEY_UVWSRC(textureType, index), texInfo.uvIndex);
material.Get(AI_MATKEY_GLTF_MAPPINGFILTER_MIN(textureType, index), texInfo.minFilter);
material.Get(AI_MATKEY_GLTF_MAPPINGFILTER_MAG(textureType, index), texInfo.magFilter);
}
@@ -414,12 +414,12 @@ static void setMaterialProperties(QSSGSceneDesc::Material &target, const aiMater
aiReturn result;
{
aiColor4D baseColorFactor;
- result = source.Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_FACTOR, baseColorFactor);
+ result = source.Get(AI_MATKEY_BASE_COLOR, baseColorFactor);
if (result == aiReturn_SUCCESS)
QSSGSceneDesc::setProperty(target, "baseColor", &QQuick3DPrincipledMaterial::setBaseColor, aiColorToQColor(baseColorFactor));
}

- if (auto baseColorTexture = createTextureNode(source, AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_TEXTURE)) {
+ if (auto baseColorTexture = createTextureNode(source, aiTextureType_BASE_COLOR, 0)) {
QSSGSceneDesc::setProperty(target, "baseColorMap", &QQuick3DPrincipledMaterial::setBaseColorMap, baseColorTexture);
QSSGSceneDesc::setProperty(target, "opacityChannel", &QQuick3DPrincipledMaterial::setOpacityChannel, QQuick3DPrincipledMaterial::TextureChannelMapping::A);
}
@@ -433,14 +433,14 @@ static void setMaterialProperties(QSSGSceneDesc::Material &target, const aiMater

{
ai_real metallicFactor;
- result = source.Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLIC_FACTOR, metallicFactor);
+ result = source.Get(AI_MATKEY_METALLIC_FACTOR, metallicFactor);
if (result == aiReturn_SUCCESS)
QSSGSceneDesc::setProperty(target, "metalness", &QQuick3DPrincipledMaterial::setMetalness, float(metallicFactor));
}

{
ai_real roughnessFactor;
- result = source.Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_ROUGHNESS_FACTOR, roughnessFactor);
+ result = source.Get(AI_MATKEY_ROUGHNESS_FACTOR, roughnessFactor);
if (result == aiReturn_SUCCESS)
QSSGSceneDesc::setProperty(target, "roughness", &QQuick3DPrincipledMaterial::setRoughness, float(roughnessFactor));
}
@@ -509,9 +509,9 @@ static void setMaterialProperties(QSSGSceneDesc::Material &target, const aiMater
}

{
- bool isUnlit = false;
- result = source.Get(AI_MATKEY_GLTF_UNLIT, isUnlit);
- if (result == aiReturn_SUCCESS && isUnlit)
+ aiShadingMode shadingMode;
+ source.Get(AI_MATKEY_SHADING_MODEL, shadingMode);
+ if (shadingMode == aiShadingMode_Unlit)
QSSGSceneDesc::setProperty(target, "lighting", &QQuick3DPrincipledMaterial::setLighting, QQuick3DPrincipledMaterial::Lighting::NoLighting);
}
} else { // Ver1

0 comments on commit 5152b07

Please sign in to comment.