Fix, assertion with shadowReceiver = false and VSM (#5055)
This commit is contained in:
@@ -185,6 +185,10 @@ namespace filament {
|
||||
if (isValidDepthVariant(variantKey)) {
|
||||
return variantKey;
|
||||
}
|
||||
// if shadow receiver is disabled, turn off VSM
|
||||
if (isLit && !(variantKey & SHADOW_RECEIVER)) {
|
||||
return variantKey & ~VSM;
|
||||
}
|
||||
// when the shading mode is unlit, remove all the lighting variants
|
||||
return isLit ? variantKey : (variantKey & UNLIT_MASK);
|
||||
}
|
||||
|
||||
@@ -586,8 +586,11 @@ void SimpleViewer::updateUserInterface() {
|
||||
}
|
||||
auto instance = rm.getInstance(entity);
|
||||
bool scaster = rm.isShadowCaster(instance);
|
||||
bool sreceiver = rm.isShadowReceiver(instance);
|
||||
ImGui::Checkbox("casts shadows", &scaster);
|
||||
rm.setCastShadows(instance, scaster);
|
||||
ImGui::Checkbox("receives shadows", &sreceiver);
|
||||
rm.setReceiveShadows(instance, sreceiver);
|
||||
size_t numPrims = rm.getPrimitiveCount(instance);
|
||||
for (size_t prim = 0; prim < numPrims; ++prim) {
|
||||
const char* mname = rm.getMaterialInstanceAt(instance, prim)->getName();
|
||||
|
||||
Reference in New Issue
Block a user