mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-12 08:11:10 +02:00
Fixed orange outline issue.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user