Skip to content
SiteEmail

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);
}

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

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.


API

Added several new shader types to reduce stencil usage. For more information, see the Rendering Migration guide

API

At-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.

API Unity

Moved the Unity3D-specific log handling functionality within the LogWriter class

API Unity

Renamed the LogHandler class to CohtmlLogHandler

Feature

Persistent local storage for the Player on Windows Desktop and Mac OS

Feature Unity

Add Performance logging support

Feature Unity

Added sample hub for easier access to all samples

Feature Unreal Engine

Added profiling scopes for Unreal insights

Enhancement

Added conversion to linear colorspace when sampling from textures. For more information, see the Rendering Migration guide

Enhancement

Added a library option to set the scripting engine (V8) flags

Enhancement

Improved error messages when loading ES6 modules with syntax errors

Enhancement

Added inventory to the Multiplayer UI sample

Enhancement

Added marketplace to the Multiplayer UI sample

Enhancement

Allow passing view specific developer options in the command line arguments of the Player

Enhancement

Added tutorial for creating a 3D compass

Enhancement

Improved the performance of drawing repeated images

Enhancement

Added a dialogue tree sample

Enhancement Unity

Added a new UI Surface Partitioning sample to the Unity3D package

Enhancement Unity

Added a new Localization sample to the Unity3D package

Enhancement Unity

Added a new in-world view sample to the Unity3D package

Enhancement Unity

Added a new View in Canvas UI sample to the Unity3D package

Enhancement Unity

Configured the correct color space in the rendering library based on the active color space in Unity3D

Enhancement Unreal Engine

Add extra guards when accessing RHI Textures

Enhancement Unreal Engine

Improved the flow of freeing rendering resources owned by the cohtml::System object

Enhancement Unreal Engine

Added texture pool for Custom Effect textures preventing memory accumulation between GC intervals

Fix

Fixed MinimalHelloCohtml sample resource handler crash when trying to load missing resources

Fix

Fixed fonts with GPOS kerning rendering composed glyphs incorrectly

Fix

Fixed missing timeline when making performance captures on Android

Fix

Fixed crash when capturing a screenshot for the Inspector on Sony PlayStation 5

Fix

Fixed setRangeText preserving incorrect selection

Fix

Fixed an issue with position: fixed when used within inline layout

Fix

Fixed a possible crash when calling UpdateWholeModel()

Fix

Fixed caret position when changing <input>/<textarea> value from JavaScript

Fix

Fixed potential crashes when using custom variables inside of @keyframes declarations

Fix

Fixed custom effect sample with OpenGL

Fix

Fixed samples linking with Vulkan on Windows ARM64

Fix

Fixed elements not being re-rendered when a valid font for weight fallback becomes available

Fix

Fixed detection of base64 URLs that was causing warnings for exceeding URL size limits and failures to parse

Fix

Fixed a wrong debug assert failure when unloading base64 images stating that the image was not found in the pending images collection

Fix

Fixed a wrong debug assert failure when using a defer attribute on inline scripts

Fix

Fixed setRangeText to throw an error when an invalid selection mode is provided

Fix

Fixed memory accumulation in the InspectorPageAgent when reloading resources

Fix

At-rules are now accessible through cssRules, making rule order correct

Fix

Styles in link elements are now accessible through stylesheets API

Fix

Media attribute of link elements can now contain 'or' and ','

Fix

Fixed wrong style in some cases when using insertrule and deleterule

Fix

Fixed nested media rules with non-absolute URLs

Fix

Fixed using insertrule with rules that have properties with non-absolute URLs

Fix

Link elements with now respond correctly to removing, adding or changing the media attribute

Fix

Fixed sometimes applying wrong styles when using complex selectors inside media rules

Fix

Fixed holding resources of inactive font-face rules in memory

Fix

Fixed sometimes applying wrong font-face rules when using multiple ones with the same FontDescription but different URLs

Fix

Added the ability to use insertrule and deleterule with media and font-face rules

Fix

Fixed a wrong debug assert failure in the DOM Builder

Fix

Fixed a bug with the CSS transitions when transitioning more than one property of the same value type

Fix

Removed dead code triggering cast-align warnings in Renoir backends

Fix Unity

Fixed surface partitioning in Unity3D Integration after changing the scene

Fix

Fixed a possible crash when calling UpdateWholeModel every frame

Fix Unity

Add data URL requests support

Fix Unreal Engine

Fixed crash when capturing the backend buffer through the Inspector

Fix Unreal Engine

Fixed Unreal Engine 4.27 Linux and Android compilation issues

Fix Unreal Engine

Fixed rendering artifacts caused by wrongly calculated scissor rect

Fix Unreal Engine

Fixed custom effects texture memory accumulation