浏览代码

Do not override edge tess factors to 1 to prevent cracks

/Yibing-Project-2
Evgenii Golubev 7 年前
当前提交
811b656b
共有 1 个文件被更改,包括 13 次插入11 次删除
  1. 24
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataMeshModification.hlsl

24
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataMeshModification.hlsl


// Settings factor to 0 will kill the triangle
return float4(0.0, 0.0, 0.0, 0.0);
}
// See comment above:
// During shadow passes, we decide that anything outside the main view frustum should not be tessellated.
if (frustumCulledMainView)
{
// Warning: currently, having different (discontinuous) tessellation factors causes
// cracks in tessellation just outside of the primary camera (view) frustum.
// The issue doesn't show up on geometry on-screen, but can become visible in shadows.
return float4(1.0, 1.0, 1.0, 1.0);
}
// We use the parameters of the primary (scene view) camera in order
// to have identical tessellation levels for both the scene view and

// TessFactor below 1.0 have no effect. At 0 it kill the triangle, so clamp it to 1.0
tessFactor.xyz = float3(max(1.0, tessFactor.x), max(1.0, tessFactor.y), max(1.0, tessFactor.z));
return CalcTriEdgeTessFactors(tessFactor);
float4 triTessFactors = CalcTriEdgeTessFactors(tessFactor);
// See comment above:
// During shadow passes, we decide that anything outside the main view frustum should not be tessellated.
if (frustumCulledMainView)
{
// Warning: we cannot modify the edge tessellation factors, as that creates cracks between patches.
// Therefore, we only modify the inside tessellation factor.
// TODO: find a way to modify the edge tessellation factors as well.
triTessFactors.w = 1.0;
}
return triTessFactors;
}
// tessellationFactors

正在加载...
取消
保存