Skip to content

Commit b6d7f09

Browse files
committed
[62.CAD] Fix alpha of hatch msdf bug
1 parent 8d778a8 commit b6d7f09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

62_CAD/Hatch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ using namespace nbl;
1919

2020
enum class HatchFillPattern: uint32_t
2121
{
22-
SOLID_FILL,
22+
SOLID_FILL = 0,
2323
CHECKERED,
2424
DIAMONDS,
2525
CROSS_HATCH,

62_CAD/fragment_shader.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ float4 main(PSInput input) : SV_TARGET
567567
{
568568
float3 msdfSample = msdfTextures.Sample(msdfSampler, float3(frac(input.position.xy / HatchFillMSDFSceenSpaceSize), float(textureId))).xyz;
569569
float msdf = nbl::hlsl::text::msdfDistance(msdfSample, MSDFPixelRange, HatchFillMSDFSceenSpaceSize / MSDFSize);
570-
localAlpha = smoothstep(+globals.antiAliasingFactor / 2.0, -globals.antiAliasingFactor / 2.0f, msdf);
570+
localAlpha *= smoothstep(+globals.antiAliasingFactor / 2.0, -globals.antiAliasingFactor / 2.0f, msdf);
571571
}
572572
}
573573
else if (objType == ObjectType::FONT_GLYPH)

0 commit comments

Comments
 (0)