Release notes

Migration guide

Migrating to 1.60

Changes in shaders

The pixel shader additional flags in CohCommonPS.ihlsl should be updated with the following values:

static const int PSAF_LinearColorSpace = 0x1;
static const int PSAF_LinearTextureSpace_0 = 0x2;
static const int PSAF_LinearTextureSpace_1 = 0x4;
static const int PSAF_ColorTextAtlas = 0x8;

The flags PSAF_LinearTextureSpace_0 and PSAF_LinearTextureSpace_1 indicate whether the shader should convert from SRGB to linear color space manually for texture slot txBuffer and txBuffer1 respectively. The conversion should be applied after sampling from textures that contain color values and not arbitrary data (e.g. signed distance field). Example:

float4 source = SAMPLE2D(txBuffer, input.Additional.xy);
if (IS_SET(int(perCommandData.y), PSAF_LinearTextureSpace_0))
{
    source.rgb = SRGBToLinear(source.rgb);
}
...
float4 source1 = SAMPLE2D(txBuffer1, input.Additional.xy);
if (IS_SET(int(perCommandData.y), PSAF_LinearTextureSpace_1))
{
    source1.rgb = SRGBToLinear(source1.rgb);
}

New shader types

In an effort to reduce stencil usage by improving clipping commands, we introduced 4 new shader types: ST_RoundedRectTexture, ST_CircleTexture, ST_EllipseTexture, ST_RoundedRectTextureRepeat. Their corresponding pixel shader types: PST_RoundedRectTexture, PST_CircleTexture(same as PST_RoundedRectTexture), PST_EllipseTexture, PST_RoundedRectTextureRepeat have been implemented in the CohShadeGeometryRare.ihlsl file. They are almost identical to their respective non-texture shader types, however instead of using the input color, they sample from an image.

In order to send additional data with every vertex, we utilized the StandardVS’s input.Position.z and output.ScreenNormalPosition.z fields, and as a result the CohStandardVS.hlsl shader was altered to null the Z output.Position for the new shader types. Below is the meaning of this field for each new shader type:

Shader Typeinput.ScreenNormalPosition.z
PST_RoundedRectTexturevalue of the edge distance
PST_RoundedRectTextureRepeatvalue of the edge distance
PST_CircleTexturecircle’s radius
PST_EllipseTextureellipse’s X-radius

The ellipse’s Y-radius in the PST_EllipseTexture shader type is stored inside the perCommandData.x field

Image repetition adjustments

Along with these changes, the logic behind the way Gameface does image repetition has also been slightly modified. Before, Gameface used to generate a lot of geometry when repeating a subimage from a texture. This has been replaced by a mathematical approach that allows us to correctly calculate the UVs that we need to sample from the texture. In order to do this, the pixel shader type PST_DrawImageRepeat had to be added and implemented inside the CohClipMasking.ihlsl, CohShadeGeometry.ihlsl and CohShadeGeometryStencil.ihlsl files.

Changelog

Version 1.60.0


Released 07 Nov 2024
APIAdded several new shader types to reduce stencil usage. For more information, see the Rendering Migration guide
APIAt-rules now support ordering. This mostly affects existing media at-rules that were previously position independent and were always overriding regular rules. Such stylesheets need to be reworked according to the standard behavior respecting cascade order.
APIUnityMoved the Unity3D-specific log handling functionality within the LogWriter class
APIUnityRenamed the LogHandler class to CohtmlLogHandler
FeaturePersistent local storage for the Player on Windows Desktop and Mac OS
FeatureUnityAdd Performance logging support
FeatureUnityAdded sample hub for easier access to all samples
FeatureUnreal EngineAdded profiling scopes for Unreal insights
EnhancementAdded conversion to linear colorspace when sampling from textures. For more information, see the Rendering Migration guide
EnhancementAdded a library option to set the scripting engine (V8) flags
EnhancementImproved error messages when loading ES6 modules with syntax errors
EnhancementAdded inventory to the Multiplayer UI sample
EnhancementAdded marketplace to the Multiplayer UI sample
EnhancementAllow passing view specific developer options in the command line arguments of the Player
EnhancementAdded tutorial for creating a 3D compass
EnhancementImproved the performance of drawing repeated images
EnhancementAdded a dialogue tree sample
EnhancementUnityAdded a new UI Surface Partitioning sample to the Unity3D package
EnhancementUnityAdded a new Localization sample to the Unity3D package
EnhancementUnityAdded a new in-world view sample to the Unity3D package
EnhancementUnityAdded a new View in Canvas UI sample to the Unity3D package
EnhancementUnityConfigured the correct color space in the rendering library based on the active color space in Unity3D
EnhancementUnreal EngineAdd extra guards when accessing RHI Textures
EnhancementUnreal EngineImproved the flow of freeing rendering resources owned by the cohtml::System object
EnhancementUnreal EngineAdded texture pool for Custom Effect textures preventing memory accumulation between GC intervals
FixFixed MinimalHelloCohtml sample resource handler crash when trying to load missing resources
FixFixed fonts with GPOS kerning rendering composed glyphs incorrectly
FixFixed missing timeline when making performance captures on Android
FixFixed crash when capturing a screenshot for the Inspector on Sony PlayStation 5
FixFixed setRangeText preserving incorrect selection
FixFixed an issue with position: fixed when used within inline layout
FixFixed a possible crash when calling UpdateWholeModel()
FixFixed caret position when changing <input>/<textarea> value from JavaScript
FixFixed potential crashes when using custom variables inside of @keyframes declarations
FixFixed custom effect sample with OpenGL
FixFixed samples linking with Vulkan on Windows ARM64
FixFixed elements not being re-rendered when a valid font for weight fallback becomes available
FixFixed detection of base64 URLs that was causing warnings for exceeding URL size limits and failures to parse
FixFixed a wrong debug assert failure when unloading base64 images stating that the image was not found in the pending images collection
FixFixed a wrong debug assert failure when using a defer attribute on inline scripts
FixFixed setRangeText to throw an error when an invalid selection mode is provided
FixFixed memory accumulation in the InspectorPageAgent when reloading resources
FixAt-rules are now accessible through cssRules, making rule order correct
FixStyles in link elements are now accessible through stylesheets API
FixMedia attribute of link elements can now contain 'or' and ','
FixFixed wrong style in some cases when using insertrule and deleterule
FixFixed nested media rules with non-absolute URLs
FixFixed using insertrule with rules that have properties with non-absolute URLs
FixLink elements with now respond correctly to removing, adding or changing the media attribute
FixFixed sometimes applying wrong styles when using complex selectors inside media rules
FixFixed holding resources of inactive font-face rules in memory
FixFixed sometimes applying wrong font-face rules when using multiple ones with the same FontDescription but different URLs
FixAdded the ability to use insertrule and deleterule with media and font-face rules
FixFixed a wrong debug assert failure in the DOM Builder
FixFixed a bug with the CSS transitions when transitioning more than one property of the same value type
FixRemoved dead code triggering cast-align warnings in Renoir backends
FixUnityFixed surface partitioning in Unity3D Integration after changing the scene
FixFixed a possible crash when calling UpdateWholeModel every frame
FixUnityAdd data URL requests support
FixUnreal EngineFixed crash when capturing the backend buffer through the Inspector
FixUnreal EngineFixed Unreal Engine 4.27 Linux and Android compilation issues
FixUnreal EngineFixed rendering artifacts caused by wrongly calculated scissor rect
FixUnreal EngineFixed custom effects texture memory accumulation