マルチグリッド法の延長と補正の閾値に名前を付ける

このコミットが含まれているのは:
routersys committed 2026-10-20 18:39:07 +09:00
1 親 285145d105
コミット de1c9a7dd0
2ファイル変更
+5 -3

検索条件に一致するファイルはありません

+3 -3
ファイルの表示
@@ -467,7 +467,7 @@ internal readonly partial struct ProlongShader(
var total = weight00 + weight10 + weight01 + weight11;
var value = 0f;
if (total > 1e-6f)
if (total > InflateSettings.MinimumInterpolationWeight)
value = (weight00 * potential[index00] + weight10 * potential[index10] + weight01 * potential[index01] + weight11 * potential[index11]) / total;
if (accumulate != 0)
@@ -576,7 +576,7 @@ internal readonly partial struct CorrectionDotShader(
var weight01 = (1f - wx) * wy * (mask[index01] & InflateSettings.MaskInside);
var weight11 = wx * wy * (mask[index11] & InflateSettings.MaskInside);
var total = weight00 + weight10 + weight01 + weight11;
if (total <= 1e-6f)
if (total <= InflateSettings.MinimumInterpolationWeight)
return 0f;
return (weight00 * potential[index00] + weight10 * potential[index10] + weight01 * potential[index01] + weight11 * potential[index11]) / total;
@@ -626,7 +626,7 @@ internal readonly partial struct CorrectionScaleShader(
if (thread == 0)
{
var total = sums[InflateSettings.CorrectionReduceThreads];
scale[0] = total > 1e-20f ? Hlsl.Clamp(sums[0] / total, 0f, maximum) : 1f;
scale[0] = total > InflateSettings.MinimumCorrectionEnergy ? Hlsl.Clamp(sums[0] / total, 0f, maximum) : 1f;
}
}
}
+2
ファイルの表示
@@ -14,6 +14,8 @@ internal static class InflateSettings
public const int CorrectionGroupThreads = CorrectionGroupSize * CorrectionGroupSize;
public const int CorrectionReduceThreads = 256;
public const float MaximumCorrectionScale = 4f;
public const float MinimumInterpolationWeight = 1e-6f;
public const float MinimumCorrectionEnergy = 1e-20f;
public const float RadiansPerDegree = MathF.PI / 180f;
public const float MaximumLightElevationDegrees = 90f;
public const float LightAzimuthLimitDegrees = 180f;