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

SH fix for spz #16055

Merged
merged 5 commits into from
Jan 14, 2025
Merged

SH fix for spz #16055

merged 5 commits into from
Jan 14, 2025

Conversation

CedricGuillemet
Copy link
Contributor

@CedricGuillemet CedricGuillemet commented Jan 10, 2025

For reference, using uint32 instead of swizzled uint8. This should have no implication on the shader.

for (let i = 0; i < splatCount; i++) {
    const c = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
    for (let j = 0; j < 15; ++j) {
        c[j * 3] = ubuf[shIndexRead + i * shComponentCount + j * 3 + 0];
        c[j * 3 + 1] = ubuf[shIndexRead + i * shComponentCount + j * 3 + 1];
        c[j * 3 + 2] = ubuf[shIndexRead + i * shComponentCount + j * 3 + 2];
    }
    sh[0][i * 4 + 0] = (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3];
    sh[0][i * 4 + 1] = (c[4] << 24) | (c[5] << 16) | (c[6] << 8) | c[7];
    sh[0][i * 4 + 2] = (c[8] << 24) | (c[9] << 16) | (c[10] << 8) | c[11];
    sh[0][i * 4 + 3] = (c[12] << 24) | (c[13] << 16) | (c[14] << 8) | c[15];

    sh[1][i * 4 + 0] = (c[16] << 24) | (c[17] << 16) | (c[18] << 8) | c[19];
    sh[1][i * 4 + 1] = (c[20] << 24) | (c[21] << 16) | (c[22] << 8) | c[23];
    sh[1][i * 4 + 2] = (c[24] << 24) | (c[25] << 16) | (c[26] << 8) | c[27];
    sh[1][i * 4 + 3] = (c[28] << 24) | (c[29] << 16) | (c[30] << 8) | c[31];

    sh[2][i * 4 + 0] = (c[32] << 24) | (c[33] << 16) | (c[34] << 8) | c[35];
    sh[2][i * 4 + 1] = (c[36] << 24) | (c[37] << 16) | (c[38] << 8) | c[39];
    sh[2][i * 4 + 2] = (c[40] << 24) | (c[41] << 16) | (c[42] << 8) | c[43];
    sh[2][i * 4 + 3] = c[44] << 24;
}

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 10, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 10, 2025

@CedricGuillemet CedricGuillemet changed the title SH support for raw ply SH fix for spz Jan 14, 2025
@CedricGuillemet CedricGuillemet marked this pull request as ready for review January 14, 2025 13:34
@CedricGuillemet CedricGuillemet merged commit 26d7e7b into BabylonJS:master Jan 14, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants