Skip to content

Conversation

@burnhamrobertp
Copy link
Contributor

Fixes beyond-all-reason/maps-metadata#567

When processing the DXT1 lookup on each block, there is a bug in color ordering, causing them to be swapped. This caused the 2-bit pixel indices to map to wrong colors, resulting in visible artifacts. This PR also updated the RGB565 conversion to use simple bit shifting instead of bit replication, which produces smoother gradients matching the reference python implementation.

This PR only updates the affected code, and does not make any of the necessary changes to publish the updated version to npm. Typically this would involve:

Updating package.json and package-lock.json with the new version
npm run build
npm publsh (whoever is running this will need to be authenticated with npm and have publish rights for the original npm package)

@burnhamrobertp
Copy link
Contributor Author

burnhamrobertp commented Feb 4, 2026

Example output (I can't remember the mipmapSize I used for this particular run, but it was very low, when artifacting aught to be at its worst; 8? Maybe 4?

image

@burnhamrobertp
Copy link
Contributor Author

For full transparency, this PR does change more than what is strictly necessary, but much of what has been changed is in better keeping with typescript best practices, more robust error handling / fallback behavior, etc.

@p2004a
Copy link
Collaborator

p2004a commented Feb 4, 2026

(ignore ci, it need to be fixed on master)

@p2004a p2004a force-pushed the master branch 2 times, most recently from ec13490 to b621d0c Compare February 8, 2026 16:00
@burnhamrobertp
Copy link
Contributor Author

This PR shouldn't have been made off of master from my fork; it makes it hard to maintain synchronicity cleanly. I'll fix my local branches and push up this PR after I've rebased, using a dedicated branch

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

Successfully merging this pull request may close these issues.

Improve quality of generated texture image

2 participants