filters
filters copied to clipboard
Bug with wgsl on some filters (v8)
https://github.com/pixijs/filters/blob/a287d90ee07ca237dfed3af5321976be6e3c6b05/filters/pixelate/src/pixelate.wgsl#L16-L30
textureSample wants a texture_2d
This is wrong on a lot of filters, and this is the fix:
@group(0) @binding(1) var uTexture: texture_2d<f32>;
@group(0) @binding(2) var uSampler: sampler;
@group(1) @binding(0) var<uniform> pixelateUniforms : PixelateUniforms;
@fragment
fn mainFragment(
@location(0) uv: vec2<f32>,
@builtin(position) position: vec4<f32>
) -> @location(0) vec4<f32> {
let pixelSize: vec2<f32> = pixelateUniforms.uSize;
let coord: vec2<f32> = mapCoord(uv);
var pixCoord: vec2<f32> = pixelate(coord, pixelSize);
pixCoord = unmapCoord(pixCoord);
return textureSample(uTexture, uSampler, pixCoord);
Thanks @pagoru ! I have updated on all filters accordingly 🙏