Capsaicin icon indicating copy to clipboard operation
Capsaicin copied to clipboard

unpackNormal unpack positive values only

Open Hineven opened this issue 1 year ago • 1 comments

core/src/math/pack.hlsl:481, the unpackNormal function fails to unpack normals with negative values packed with packNormal.

The current implementation of unpackNormal is:

/**
 * Convert 10bit snorms to normal vector.
 * @param packedValue Input snorm values to convert.
 * @returns Converted float values (range [-1,1]).
 */
float3 unpackNormal(uint packedValue)
{
    uint3 value = uint3(packedValue, packedValue >> 10,
        packedValue >> 20) & 0x3FFu.xxx;
    return float3(value) * (1.0f / 511.0f).xxx;
}

It fails to unpack negative values.

Hineven avatar Apr 15 '24 05:04 Hineven

Thanks, weve fixed this internally and should be out in the next release version.

maoliver-amd avatar Apr 17 '24 04:04 maoliver-amd