diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index 953b09e13d..60d66b7ecf 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -1110,7 +1110,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace : SV_IsFrontFace) if (SharedData::extendedMaterialSettings.EnableComplexMaterial) { const float kMaskEpsilon = (4.0 / 255.0); - complexMaterial = envMaskSample.w < (1.0 - kMaskEpsilon); + complexMaterial = TexEnvMaskSampler.SampleLevel(SampEnvMaskSampler, uv, 15).w < (1.0 - kMaskEpsilon); // Detect texture saved in the wrong format if ((abs(envMaskSample.x - envMaskSample.y) < kMaskEpsilon) && @@ -1119,7 +1119,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace : SV_IsFrontFace) complexMaterial = false; if (complexMaterial) { - if (envMaskSample.w > kMaskEpsilon) { + if (envMaskSample.w > kMaskEpsilon && envMaskSample.w < (1.0 - kMaskEpsilon)) { complexMaterialParallax = true; mipLevel = ExtendedMaterials::GetMipLevel(uv, TexEnvMaskSampler, screenNoise); uv = ExtendedMaterials::GetParallaxCoords(viewPosition.z, uv, mipLevel, viewDirection, tbnTr, screenNoise, TexEnvMaskSampler, SampTerrainParallaxSampler, 3, displacementParams, pixelOffset