Release notes

Changelog

Version 1.13.1.3


Released 03 Mar 2021
FeatureImproved text rendering
FeatureUpdated V8 to version 8.8.278 for Microsoft Windows
FeaturePrecise text layout and positioning
FeatureEmbedded a last resort fallback font
FeatureImplemented font preloading to avoid reading fonts from disk in time critical threads
FeatureNintendo Switch uses V8 for JavaScript execution
EnhancementOptimized matching of complex selectors against DOM elements
EnhancementAdd support for automatic binding of UFunctions without parameters in Unreal Engine 4
EnhancementAdded option in Unreal Engine 4 plugin for setting the default font
EnhancementChanged the Unreal Engine 4 plugin modules to be ClientOnly
FixFixed growing memory usage when data-bind-for is used inside data-bind-if
FixFixed advancing a View without a document
FixFixed a layout issue with aligned inline text
FixFixed a freeze when using font-fit mode fit
FixFix a crash in UMG Editor after saving UMG widgets with Cohtml and GT Widget in Unreal Engine 4.26
APINew font API for preloading fonts with specific font description
APIDeprecated the AddFontsFromFolder API
APIDeprecated the SetDefaultFallbackFontName API

Migration guide

  • Until 1.13 when we wanted to clear the depth in the current RT when the capability for clearing with a fullscreen triangle was enabled, we used the ST_ClearQuadWithDepth shader type which was writing depth in the pixel shader. Now we’ll use the geometry to set Z values in the depth buffer and we’ll use the ST_ClearQuad shader type.
  • Text can be drawn on fractional pixel coordinates. Until now, the position of a text run has always been snapped to the nearest whole pixel. This can lead to bad-looking text animations. Because of that, we’ve decided that we want to lift this restriction and allow texts to be positioned on fractional coordinates. This is a change that breaks backward compatibility and there is no way to enable the position snapping again. The images below show the difference between before and after this change for text positioned at a 0.5 pixel offset.
  • SDF glyphs are rendered on the GPU by default. This has a positive effect on the performance, as well as on the visual fidelity when text is rendered on fractional coordinates. The developer option --allowSDFonGPU now becomes --disableSDFonGPU. With that, to restore the old behavior of the rendering library (SDF glyphs rendered on the CPU), the option --disableSDFonGPU needs to be used.

  • The threshold for using SDF instead of raster rendering of fonts is set to 10 (previously 18). The GPU rendering algorithm for SDF allows us to use SDF glyphs even at smaller sizes and hence we’ve adjusted the size threshold that decides how a font is rendered. Till now this threshold has been a constant value but now it can be adjusted through the developer option --sdfTextSizeThreshold. The old behavior of the rendering library can be restored when the option is used like --sdfTextSizeThreshold 18. To note is that this change also affects the font hinting for font sizes between 10 and 18. As a consequence, the effective width of some letters can change. The images below show the text rendering with the old and new default values.

  • SDF glyphs are now rendered onto 16-bit textures by default. Previously the glyphs were rendered on 8-bit textures, but this can lead to inconsistent visual results because of rounding errors on the GPU during interpolation. Therefore, a glyph can look different when it’s in different places in the glyph atlas. To note is, however, that the difference is barely noticeable. 16-bit textures solve this problem, but consume twice as much memory. The old behavior for the SDF rendered on the GPU can be brought back with the developer option --8bitGPUSDFTextures. To note is that if the 8-bit textures are in use, the provided shaders have to be recompiled with the define USE_8BIT_GPUSDF_ATLASES 1.

  • Because of the previous change, we also introduce a new pixel format in our rendering library - renoir::PF_R16. The format is meant to represent 16-bit unsigned normalized values. That is, textures created with this format are R16Unorm. In the backends, the 16-bit textures are created with this format. The one exception to this is the GLES2 backend, where only 8-bit textures are created regardless of the renoir::PF_R16 format.

Important The PS4 and PS5 backends create R16Float textures for the renoir::PF_R16 format because of a known blending issue with R16Unorm textures on these platforms.

  • The pixel format renoir::PF_A8 is removed in favor of renoir::PF_R8. With that, all of the shaders and the backends are adjusted.
  • The ST_TextSDFGPU shader type is moved to the standard pixel shader - CohStandardPS.hlsl. The mappings in the backends are adjusted as well.
  • Added optional multi-sampling for the ST_TextSDFGPU shader type. The code for drawing glyphs from a GPU-generated SDF atlas is in CohShadeGeometry.ihlsl. If the define COH_ALLOW_SS is present in the file during shader compilation, the multi-sampling is enabled. By default it is disabled. The multi-sampling does 4 samples of the glyph atlas to increase the quality of the rendered text at small font sizes - 14 and lower - but it also has a negative performance impact.

Rendering changes summary

As there are quite a few changes to the rendering pipeline, we’ll summarize in several steps what is to be done in the client code

  • Remove the ST_ClearQuadWithDepth shader type as it does not exist anymore.
  • The ST_TextSDFGPU shader type is not handled in the standard shader so the backend mappings have to be adjusted
  • The format renoir::PF_A8 is now renoir::PF_R8 so the backends and shaders have to be adjusted to handle it.
  • The new format renoir::PF_R16 is introduced so the backends should be able to create R16Unorm textures for it.