Annotations
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
float boxMask(float2 point, float2 halfSize, float feather)
|
||||
{
|
||||
// Signed-distance box mask gives the chart and border pixel-sized feathered
|
||||
// edges without branching per side.
|
||||
float2 distanceToEdge = abs(point) - halfSize;
|
||||
float outsideDistance = length(max(distanceToEdge, float2(0.0, 0.0)));
|
||||
float insideDistance = min(max(distanceToEdge.x, distanceToEdge.y), 0.0);
|
||||
@@ -31,6 +33,8 @@ float applyToneCurve(float linearLevel)
|
||||
float patchBrightness(int patchIndex, int count)
|
||||
{
|
||||
int clampedIndex = clamp(patchIndex, 0, max(count - 1, 0));
|
||||
// Each patch is one stop brighter than the previous patch until it clips at
|
||||
// the requested peak level, matching the Xyla-style exposure ramp.
|
||||
float linearLevel = baseLevel * exp2(float(clampedIndex));
|
||||
linearLevel = min(linearLevel, peakLevel);
|
||||
return applyToneCurve(linearLevel);
|
||||
@@ -60,6 +64,8 @@ float4 shadeVideo(ShaderContext context)
|
||||
if (reverseOrder)
|
||||
patchIndex = count - 1 - patchIndex;
|
||||
|
||||
// Build each patch as a slot along the main axis, then mask the cross-axis
|
||||
// extents so vertical and horizontal charts share the same logic.
|
||||
float patchSlotCenter = (floor(patchPosition) + 0.5) / float(count);
|
||||
float localAxis = abs(normalizedAxis - patchSlotCenter) * float(count) * 2.0;
|
||||
float safeGapSize = saturate(gapSize);
|
||||
|
||||
Reference in New Issue
Block a user