Fix more issues with VSM settings for the remote UI

This commit is contained in:
Mathias Agopian
2021-06-25 16:54:41 -07:00
committed by Mathias Agopian
parent e7b90f9c12
commit 36d7f6ff94
3 changed files with 8 additions and 13 deletions

View File

@@ -96,10 +96,6 @@ void ShadowMapManager::render(FrameGraph& fg, FEngine& engine, FView& view,
if (!map.hasVisibleShadows()) {
continue;
}
const uint8_t layer = map.getLayout().layer;
assert_invariant(layer < MAX_SHADOW_LAYERS);
assert_invariant(layer < textureRequirements.layers);
map.getShadowMap().render(driver, view.getVisibleDirectionalShadowCasters(), pass, view);
passes.emplace_back(&map, pass);
}
@@ -110,10 +106,6 @@ void ShadowMapManager::render(FrameGraph& fg, FEngine& engine, FView& view,
if (!map.hasVisibleShadows()) {
continue;
}
const uint8_t layer = map.getLayout().layer;
assert_invariant(layer < textureRequirements.layers);
assert_invariant(layer < MAX_SHADOW_LAYERS);
pass.setVisibilityMask(VISIBLE_SPOT_SHADOW_RENDERABLE_N(i));
map.getShadowMap().render(driver, view.getVisibleSpotShadowCasters(), pass, view);
pass.clearVisibilityMask();

View File

@@ -104,7 +104,7 @@ UniformInterfaceBlock const& UibGenerator::getPerViewUib() noexcept {
.add("padding1", 1, UniformInterfaceBlock::Type::FLOAT2)
.add("vsmExponent", 1, UniformInterfaceBlock::Type::FLOAT)
.add("vsmDepthScale", 1, UniformInterfaceBlock::Type::FLOAT, Precision::HIGH)
.add("vsmDepthScale", 1, UniformInterfaceBlock::Type::FLOAT)
.add("vsmLightBleedReduction", 1, UniformInterfaceBlock::Type::FLOAT)
.add("vsmReserved0", 1, UniformInterfaceBlock::Type::FLOAT)

View File

@@ -751,7 +751,9 @@ static int parse(jsmntok_t const* tokens, int i, const char* jsonChunk,
for (int j = 0; j < size; ++j) {
const jsmntok_t tok = tokens[i];
CHECK_KEY(tok);
if (compare(tok, jsonChunk, "screenSpaceContactShadows") == 0) {
if (compare(tok, jsonChunk, "mapSize") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->mapSize);
} else if (compare(tok, jsonChunk, "screenSpaceContactShadows") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->screenSpaceContactShadows);
} else if (compare(tok, jsonChunk, "shadowCascades") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->shadowCascades);
@@ -1173,6 +1175,7 @@ static std::ostream& operator<<(std::ostream& out, const LightManager::ShadowOpt
<< "\"msaaSamples\": " << int(in.vsm.msaaSamples) << ",\n"
<< "\"blurWidth\": " << in.vsm.blurWidth << "\n"
<< "},\n"
<< "\"mapSize\": " << in.mapSize << ",\n"
<< "\"screenSpaceContactShadows\": " << to_string(in.screenSpaceContactShadows) << ",\n"
<< "\"shadowCascades\": " << int(in.shadowCascades) << ",\n"
<< "\"cascadeSplitPositions\": " << (splitsVector) << "\n"
@@ -1288,9 +1291,9 @@ static std::ostream& operator<<(std::ostream& out, const VsmShadowOptions& in) {
return out << "{\n"
<< "\"anisotropy\": " << int(in.anisotropy) << ",\n"
<< "\"mipmapping\": " << to_string(in.mipmapping) << ",\n"
<< "\"exponent\": " << int(in.exponent) << ",\n"
<< "\"minVarianceScale\": " << int(in.minVarianceScale) << ",\n"
<< "\"lightBleedReduction\": " << int(in.lightBleedReduction) << "\n"
<< "\"exponent\": " << in.exponent << ",\n"
<< "\"minVarianceScale\": " << in.minVarianceScale << ",\n"
<< "\"lightBleedReduction\": " << in.lightBleedReduction << "\n"
<< "}";
}