Artifacts in filter using texture as uniform
See original GitHub issueI’m running into an issue with a simple custom filter that maps the colors in a grayscale image to a 256x1 gradient texture. There are strange artifacts throughout the filtered result. Could it be an issue with sampling pixels in the fragment shader?
Behavior
Steps to Reproduce
https://codepen.io/bryan_d/pen/JjbXrQJ
Environment
pixi.js
5.3.7- Browser: Chrome 88
- OS: Windows 10
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Artifacts in filter using texture as uniform #7234 - GitHub
I'm running into an issue with a simple custom filter that maps the colors in a grayscale image to a 256x1 gradient texture....
Read more >Bilinear texture filtering – artifacts, alternatives, and frequency ...
Bilinear filtering is a texture (or more generally, signal) interpolation filter that is separable – it is a linear filter applied on the...
Read more >Artifacts from linear filtering a floating point texture in the ...
The built-in linear filtering works on both GPUs, but I still need the manual filtering as a fallback for GPUs that don't support...
Read more >Textures - LearnOpenGL
Try to set the texture filtering method to GL_NEAREST to see the pixels more clearly: solution. Use a uniform variable as the mix...
Read more >Texture sampling artifacts and floor() - Khronos Forums
Hello, I have a strange texture sampling artifact when using a binary ramp (constructed with the floor() function) to access a texture.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By default in v5 and v6 texture is mipmapped if its dimensions are powers of two.
For any color maps you have to use something like
new PIXI.BaseTexture(document.querySelector(selector), { mipmap: 0, scaleMode: 0 });
color.r
is not actually a good coord.(coord.r * 255.0 + 0.5) / 256.0
is the center of pixel in gradient texture, either use it in formulae either use scaleMode 0 (NEAREST)mipmap 0 means
POW2
, scaleMode 0 meansNEAREST
in pixi constants.Confirmed, thanks for taking a look (and for the additional tip).