mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 11:43:16 +02:00
Fixing the missing field for blender translucent map
This commit is contained in:
parent
3c075532f8
commit
3274df9923
3 changed files with 14 additions and 5 deletions
|
@ -1098,8 +1098,9 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS
|
|||
diffuseTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1));
|
||||
} else if (type.contains("tex_color_map")) {
|
||||
diffuseTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1));
|
||||
} else if (type.contains("transparentcolor")) { // it should be TransparentColor...
|
||||
// THis is how Maya assign a texture that affect diffuse color AND transparency ?
|
||||
} else if (type.contains("transparentcolor")) { // Maya way of passing TransparentMap
|
||||
transparentTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1));
|
||||
} else if (type.contains("transparencyfactor")) { // Blender way of passing TransparentMap
|
||||
transparentTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1));
|
||||
} else if (type.contains("bump")) {
|
||||
bumpTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1));
|
||||
|
|
|
@ -102,16 +102,20 @@ void FBXReader::consolidateFBXMaterials() {
|
|||
detectDifferentUVs = (diffuseTexture.texcoordSet != 0) || (!diffuseTexture.transform.isIdentity());
|
||||
}
|
||||
|
||||
|
||||
FBXTexture transparentTexture;
|
||||
QString transparentTextureID = transparentTextures.value(material.materialID);
|
||||
// If PBS Material, systematically bind the albedo texture as transparency texture and check for the alpha channel
|
||||
if (material.isPBSMaterial) {
|
||||
transparentTextureID = diffuseTextureID;
|
||||
}
|
||||
if (!transparentTextureID.isNull()) {
|
||||
transparentTexture = getTexture(transparentTextureID);
|
||||
|
||||
material.opacityTexture = transparentTexture;
|
||||
detectDifferentUVs |= (transparentTexture.texcoordSet != 0) || (!transparentTexture.transform.isIdentity());
|
||||
}
|
||||
|
||||
|
||||
|
||||
FBXTexture normalTexture;
|
||||
QString bumpTextureID = bumpTextures.value(material.materialID);
|
||||
QString normalTextureID = normalTextures.value(material.materialID);
|
||||
|
|
|
@ -84,8 +84,12 @@ void Material::setMetallic(float metallic) {
|
|||
void Material::setTextureMap(MapChannel channel, const TextureMapPointer& textureMap) {
|
||||
if (textureMap) {
|
||||
_key.setMapChannel(channel, (true));
|
||||
|
||||
|
||||
if (channel == MaterialKey::ALBEDO_MAP) {
|
||||
// clear the previous flags whatever they were:
|
||||
_key.setOpacityMaskMap(false);
|
||||
_key.setTranslucentMap(false);
|
||||
|
||||
if (textureMap->useAlphaChannel()) {
|
||||
if (textureMap->isDefined()) {
|
||||
if (textureMap->getTextureView().isValid()) {
|
||||
|
|
Loading…
Reference in a new issue