You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add_library(Freetype::FreetypeALIASfreetype) # alias target for MSDFGEN not trying to find freetype system-wide but rather to use the logical target available in our build tree
30
+
31
+
# msdfgen
32
+
set(MSDFGEN_CORE_ONLYOFF) # if turned on then MSDFGEN will be built without dependencies like freetype or skia
state->normalization.prepass(decodeBuffer,readBlockPos*blockDims+commonExecuteData.offsetDifferenceInTexels,blockX,blockY,4u/*TODO: figure this out*/);
87
80
}
@@ -143,7 +136,6 @@ class CSwizzleAndConvertImageFilter : public CImageFilter<CSwizzleAndConvertImag
Returns the distance to the shape in the given MSDF.
21
+
This can then be processed using smoothstep to provide anti-alising when rendering the shape.
22
+
23
+
@params:
24
+
- msdfSample: sampled SNORM value from the MSDF texture generated by msdfgen library.
25
+
26
+
- msdfPixelRange: specifies the width of the range around the shape between the minimum and maximum representable signed distance in shape units or distance field pixels, respectivelly.
27
+
for example if msdfPixelRange is 4, then the range of distance values are [-2, +2], and it can be computed by snormValue * MSDFPixelRange/2.0
28
+
so an snorm value of 1.0 means a distance of 2 pixels outside the shape (in msdf texture space)
29
+
This value is set when rendering the MSDF with MSDFgen.
30
+
31
+
- screenPxRangeValue: the value used to convert the distance values in the msdf texture/atlas to distance in screen space.
32
+
In other words it's DistanceInScreenSpace/DistanceInMSDFTextureSpace, the larger the glyph (or more zoomed in) the larger this value is.
33
+
In 2D Text Rendering it is computed by `GlyphScreenSpaceSize/GlyphTextureSpaceSize`
34
+
where GlyphTextureSpaceSize is the size of the glyph inside the msdf texture/atlas
0 commit comments