Hello,
We are trying to understand exactly what the Depth Prepass is doing for Single Layer Water and why it is considered required in the code.
We are aware that to achieve soft shadows on Single Layer Water, it requires the following cvars:
- r.Water.SingleLayer.ShadersSupportVSMFiltering
- r.Water.SingleLayer.VSMFiltering
- r.Water.SingleLayer.DepthPrepass
The first two seem pretty clear. Toggling the VSMFiltering has a notable effect on the water shadows going from completely crisp to expected soft shadows (see images). However, there seems to be no effect from changing Depth Prepass. A look at the code say the Depth Prespass is required (see code snippet). So could you please clarify this for us? Specifically:
- Confirmation the Depth Prepass is required
- And why VSM is dependent on the Depth Prepass
Thank you
bool IsSingleLayerWaterDepthPrepassEnabled(const FStaticShaderPlatform Platform, const FStaticFeatureLevel FeatureLevel) { static const auto CVarWaterSingleLayerDepthPrepass = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Water.SingleLayer.DepthPrepass")); const bool bPrepassEnabled = CVarWaterSingleLayerDepthPrepass && CVarWaterSingleLayerDepthPrepass->GetInt() > 0; // Currently VSM is the only feature dependent on the depth prepass which is why we only enable it if VSM could also be enabled. // VSM can be toggled at runtime, but we need a compile time value here, so we fall back to DoesPlatformSupportVirtualShadowMaps() to check if // VSM *could* be enabled. const bool bVSMSupported = DoesPlatformSupportVirtualShadowMaps(Platform);