Soften cursor profile seam
This commit is contained in:
parent
4e5e498956
commit
69244ade75
4 changed files with 14 additions and 4 deletions
|
|
@ -276,12 +276,19 @@ float cursorTopProfileSlope(float t)
|
|||
|
||||
float cursorBottomProfileRadius(float t)
|
||||
{
|
||||
return 1.0 - sqrt(saturate(t));
|
||||
static const float SqrtSoftening = 0.035;
|
||||
float root0 = sqrt(SqrtSoftening);
|
||||
float root1 = sqrt(1.0 + SqrtSoftening);
|
||||
float x = (sqrt(saturate(t) + SqrtSoftening) - root0) / (root1 - root0);
|
||||
return 1.0 - x;
|
||||
}
|
||||
|
||||
float cursorBottomProfileSlope(float t)
|
||||
{
|
||||
return -0.5 * rsqrt(max(saturate(t), 0.001));
|
||||
static const float SqrtSoftening = 0.035;
|
||||
float root0 = sqrt(SqrtSoftening);
|
||||
float root1 = sqrt(1.0 + SqrtSoftening);
|
||||
return -0.5 * rsqrt(saturate(t) + SqrtSoftening) / (root1 - root0);
|
||||
}
|
||||
|
||||
float cursorTopSdf(float3 p)
|
||||
|
|
|
|||
Loading…
Reference in a new issue