Skip to content

Commit edb595e

Browse files
LilithDuncanUnityEvergreen
authored andcommitted
Fix terrain holes rendering on Quest4 and Pico2 - UUM 61913
Fixes a bug with terrain rendering on Quest2/Pico4 where holes would not display properly. [UUM-61913](https://jira.unity3d.com/browse/UUM-61913)
1 parent 8188c28 commit edb595e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitInput.hlsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ SAMPLER(sampler_TerrainHolesTexture);
9393
void ClipHoles(float2 uv)
9494
{
9595
float hole = SAMPLE_TEXTURE2D(_TerrainHolesTexture, sampler_TerrainHolesTexture, uv).r;
96-
clip(hole == 0.0f ? -1 : 1);
96+
// Fixes bug where compression is enabled and 0 isn't actually 0 but low like 1/2047. (UUM-61913)
97+
float epsilon = 0.0005f;
98+
clip(hole < epsilon ? -1 : 1);
9799
}
98100
#endif
99101

0 commit comments

Comments
 (0)