From 92659dbf200e7e2a78f2aafc135c3df4896ffc5e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 14:45:27 +0100 Subject: [PATCH] Tighten Bokusho page contact core --- .../Render/BokushoBrushSimulation.cs | 5 +++-- src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Aquarium.Engine.Contracts/Render/BokushoBrushSimulation.cs b/src/Aquarium.Engine.Contracts/Render/BokushoBrushSimulation.cs index 8b15da1..03c8929 100644 --- a/src/Aquarium.Engine.Contracts/Render/BokushoBrushSimulation.cs +++ b/src/Aquarium.Engine.Contracts/Render/BokushoBrushSimulation.cs @@ -375,6 +375,7 @@ public static class BokushoBrushSimulation var tuftT = Saturate(lateral / MathF.Max(footprint, 0.001f) * 0.5f + 0.5f); var distance = MathF.Sqrt(bestDistance); var contact = SmoothStep(1.0f, 0.0f, distance / MathF.Max(footprint * 0.80f, 0.001f)); + var contactCore = contact * contact * (3.0f - 2.0f * contact); var tooth = PaperTooth(world, strokeIndex); var edge = Saturate(distance / MathF.Max(footprint * 0.80f, 0.001f)); var dryBreak = SmoothStep(0.18f + tooth * 0.18f, 0.92f, edge) * (1.0f - Saturate(frame.Wetness / 1.6f)) * (0.34f + stroke.SplitScale * 0.12f); @@ -415,7 +416,7 @@ public static class BokushoBrushSimulation var tipContact = MathF.Max(SmoothStep(1.0f, 0.0f, ellipse), sweepContact * 0.86f); var contribution = canvas[index] * tipContact - * (0.20f + contact * 0.80f) + * (0.03f + contactCore * 0.97f) * (1.0f - MathF.Abs(sampleDelta) * 0.045f) * (0.82f + sweepContact * 0.24f); pigmentPeak = MathF.Max(pigmentPeak, contribution); @@ -423,7 +424,7 @@ public static class BokushoBrushSimulation } } - return Saturate(pigmentPeak * 1.14f + pigmentFlow * 0.026f) * hold * (0.30f + pressure * 0.38f + Saturate(frame.InkLoad * 0.5f) * 0.18f); + return Saturate(pigmentPeak * 1.30f + pigmentFlow * 0.010f) * hold * (0.36f + pressure * 0.44f + Saturate(frame.InkLoad * 0.5f) * 0.20f); } private static float StrokeTaper(float t, float entryTaper, float exitTaper) diff --git a/src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl b/src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl index f2d650d..406abd1 100644 --- a/src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl +++ b/src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl @@ -281,6 +281,7 @@ float bokushoStrokePageHeight(float2 world, BokushoBrushStroke stroke, uint stro float tuftT = saturate(lateral / max(footprint, 0.001) * 0.5 + 0.5); float distance = sqrt(bestDistance); float contact = smoothstep(1.0, 0.0, distance / max(footprint * 0.80, 0.001)); + float contactCore = contact * contact * (3.0 - 2.0 * contact); float tooth = bokushoPaperTooth(world, strokeIndex); float edge = saturate(distance / max(footprint * 0.80, 0.001)); float dryBreak = smoothstep(0.18 + tooth * 0.18, 0.92, edge) @@ -321,7 +322,7 @@ float bokushoStrokePageHeight(float2 world, BokushoBrushStroke stroke, uint stro float pigment = BokushoCanvasField[((strokeIndex * tuftCount) + tuftIndex) * sampleCount + sampleIndex]; float contribution = pigment * tipContact - * (0.20 + contact * 0.80) + * (0.03 + contactCore * 0.97) * (1.0 - abs((float)sampleDelta) * 0.045) * (0.82 + sweepContact * 0.24); pigmentPeak = max(pigmentPeak, contribution); @@ -329,7 +330,7 @@ float bokushoStrokePageHeight(float2 world, BokushoBrushStroke stroke, uint stro } } - return saturate(pigmentPeak * 1.14 + pigmentFlow * 0.026) * hold * (0.30 + pressure * 0.38 + saturate(bokushoMaterial.z * 0.5) * 0.18); + return saturate(pigmentPeak * 1.30 + pigmentFlow * 0.010) * hold * (0.36 + pressure * 0.44 + saturate(bokushoMaterial.z * 0.5) * 0.20); } float bokushoPageHeight(float2 world)