Skip to content

Commit

Permalink
Fix ineffective FOG variant filter (#6968)
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado committed Jul 20, 2023
1 parent 176915b commit 626577f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions NEW_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).

## Release notes for next branch cut

- matc: fix buggy `variant-filter` flag
- web: Added missing setMat3Parameter()/setMat4Parameter() to MaterialInstance
14 changes: 7 additions & 7 deletions libs/filabridge/src/Variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,32 @@ Variant Variant::filterUserVariant(
Variant variant, UserVariantFilterMask filterMask) noexcept {
// these are easy to filter by just removing the corresponding bit
if (filterMask & (uint32_t)UserVariantFilterBit::DIRECTIONAL_LIGHTING) {
variant.key &= ~(filterMask & DIR);
variant.key &= ~DIR;
}
if (filterMask & (uint32_t)UserVariantFilterBit::DYNAMIC_LIGHTING) {
variant.key &= ~(filterMask & DYN);
variant.key &= ~DYN;
}
if (filterMask & (uint32_t)UserVariantFilterBit::SKINNING) {
variant.key &= ~(filterMask & SKN);
variant.key &= ~SKN;
}
if (!isValidDepthVariant(variant)) {
// we can't remove FOG from depth variants, this would, in fact, remove picking
if (filterMask & (uint32_t)UserVariantFilterBit::FOG) {
variant.key &= ~(filterMask & FOG);
variant.key &= ~FOG;
}
} else {
// depth variants can have their VSM bit filtered
if (filterMask & (uint32_t)UserVariantFilterBit::VSM) {
variant.key &= ~(filterMask & VSM);
variant.key &= ~VSM;
}
}
if (!isSSRVariant(variant)) {
// SSR variant needs to be handled separately
if (filterMask & (uint32_t)UserVariantFilterBit::SHADOW_RECEIVER) {
variant.key &= ~(filterMask & SRE);
variant.key &= ~SRE;
}
if (filterMask & (uint32_t)UserVariantFilterBit::VSM) {
variant.key &= ~(filterMask & VSM);
variant.key &= ~VSM;
}
} else {
// see if we need to filter out the SSR variants
Expand Down

0 comments on commit 626577f

Please sign in to comment.