Skip to content

fix: ColorMapFilter alpha issues#512

Open
albinkong wants to merge 2 commits intopixijs:mainfrom
albinkong:main
Open

fix: ColorMapFilter alpha issues#512
albinkong wants to merge 2 commits intopixijs:mainfrom
albinkong:main

Conversation

@albinkong
Copy link
Copy Markdown
Contributor

@albinkong albinkong commented Jan 23, 2026

I have ran into some issues with the ColorMapFilter and alpha. I created a
reproduction (zip) that can be run locally and have provided screenshots of the demo below.

In general the filter did not properly handle the premultiplied nature of the textures and had some issues with still having the blue channel as linear when set to nearest.

I've also updated the documentation for the color map texture as well as added an example color map to the filter's folder.

There are two breaking changes in this PR: the keys in ColorMapFilter.uniform have changed, and the way the filter looks will be less "glitchy" (most obvious on the bottom image in the "Passthrough 4x4x4, nearest"-example).

Screenshots of different color maps that can be seen in the example code.

Passthrough 4x4x4, linear

compare_passthrough_04_linear

Passthrough 4x4x4, nearest

compare_passthrough_04_nearest

Hue rotate 4x4x4, linear

compare_hue_04_linear

Hue rotate 4x4x4, nearest

compare_hue_04_nearest

Passthrough 32x32x32, linear

compare_passthrough_32_linear

Passthrough 32x32x32, nearest

compare_passthrough_32_nearest

@albinkong
Copy link
Copy Markdown
Contributor Author

I am tempted to add passing FilterWithShader to the constructor, but want to wait for feedback before making such a change.

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.

1 participant