Fixed orange outline issue.

This commit is contained in:
Justin Marshall
2026-05-24 14:43:15 -07:00
parent 4e6d4a281f
commit 1bd467154e
+10
View File
@@ -4219,6 +4219,15 @@ float QD3D12_TessellationDisplacementFade(float4 clipPos)
return QD3D12_DistanceFadeFromClip(clipPos, QD3D12_TESS_DISTANCE_NEAR, QD3D12_TESS_DISTANCE_FAR);
}
float QD3D12_TessellationPatchEdgeFade(float3 bary)
{
// Keep original patch edges on the undisplaced mesh. Brush seams and room
// corners often meet only at those edges; moving both sides along different
// normals can open real gaps that show the background.
float edgeDistance = min(bary.x, min(bary.y, bary.z));
return smoothstep(0.0, 0.08, edgeDistance);
}
float QD3D12_ComputeNormalMapTessEdgeFactor(VSOut a, VSOut b)
{
if (gUseNormalMap <= 0.5)
@@ -4340,6 +4349,7 @@ VSOut DSMain(HSConstOut tessFactors, float3 bary : SV_DomainLocation, const Outp
float height = QD3D12_GetFilteredTessHeight(i.uv0);
float centeredHeight = QD3D12_CleanCenteredTessHeight(height);
float displacementFade = QD3D12_TessellationDisplacementFade(i.currClip);
displacementFade *= QD3D12_TessellationPatchEdgeFade(bary);
float reliefConfidence = QD3D12_GetPomConfidence(i.uv0);
float displacement = centeredHeight * gTessellationDisplacement * displacementFade * reliefConfidence;
float3 displacedObjPos = i.objPos + objNormal * displacement;