Skip to content

Commit

Permalink
Traktor: For now do not enable alpha blend path for FBX meshes which …
Browse files Browse the repository at this point in the history
…has a Alpha value of 1.
  • Loading branch information
apistol78 committed Apr 15, 2024
1 parent ea73caa commit 7b31cb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions code/Model/Formats/Fbx/MaterialConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,11 @@ bool convertMaterials(Model& outModel, SmallMap< int32_t, int32_t >& outMaterial

if (material->pbr.opacity.has_value)
{
mm.setTransparency(material->pbr.opacity.value_real);
mm.setBlendOperator(Material::BoAlpha);
if (material->pbr.opacity.value_real < 1.0f - FUZZY_EPSILON)
{
mm.setTransparency(material->pbr.opacity.value_real);
mm.setBlendOperator(Material::BoAlpha);
}
}

if (material->pbr.base_color.texture)
Expand Down
5 changes: 3 additions & 2 deletions code/Model/Formats/Fbx/SkeletonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ Ref< Pose > convertPose(
return nullptr;

// Find evaluated skeleton.
//#fixme Ensure it's the same skeleton...
ufbx_node* eskeletonNode = search(escene->root_node, [&](ufbx_node* node) {
return (node->children.count > 0 && node->bind_pose != nullptr);
return node->element_id == skeletonNode->element_id;
});
if (!eskeletonNode)
return nullptr;

const Matrix44 Mrx90 = rotateX(deg2rad(-90.0f));

Expand Down

0 comments on commit 7b31cb5

Please sign in to comment.