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
Copy file name to clipboardExpand all lines: include/nbl/builtin/hlsl/text_rendering/msdf.hlsl
+11-12Lines changed: 11 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -23,19 +23,18 @@ This can then be processed using smoothstep to provide anti-alising when renderi
23
23
@params:
24
24
- msdfSample: sampled SNORM value from the MSDF texture generated by msdfgen library.
25
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
26
+
- pixelRange = msdfPixelRange * screenPxRangeValue, It is the value to convert snorm distance to screen space distance
27
+
- 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.
28
+
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
29
+
so an snorm value of 1.0 means a distance of 2 pixels outside the shape (in msdf texture space)
30
+
This value is set when rendering the MSDF with MSDFgen.
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