Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unpackNormal unpack positive values only #17

Open
Hineven opened this issue Apr 15, 2024 · 1 comment
Open

unpackNormal unpack positive values only #17

Hineven opened this issue Apr 15, 2024 · 1 comment

Comments

@Hineven
Copy link

Hineven commented Apr 15, 2024

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.

@maoliver-amd
Copy link
Collaborator

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

Hineven added a commit to Hineven/Capsaicin that referenced this issue Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants