Skip to content

Commit

Permalink
Change mag min filter to linear (#54)
Browse files Browse the repository at this point in the history
* Changed MAG/MIN texture filtering from NEAREST to LINEAR

* 0.14.0
  • Loading branch information
ydaniv authored Dec 14, 2024
1 parent 14d7e18 commit 9528d2b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3167,8 +3167,8 @@ function createTexture(
gl.TEXTURE_WRAP_T,
gl[_getTextureWrap(wrap.y || wrap)],
);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);

if (data) {
// Upload the image into the texture
Expand Down
4 changes: 2 additions & 2 deletions index.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3171,8 +3171,8 @@ void main() {
gl.TEXTURE_WRAP_T,
gl[_getTextureWrap(wrap.y || wrap)],
);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);

if (data) {
// Upload the image into the texture
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kampos",
"version": "0.13.1",
"version": "0.14.0",
"description": "Tiny and fast effects compositor on WebGL",
"registry": "https://registry.npmjs.org/",
"main": "dist/index.cjs",
Expand Down
4 changes: 2 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,8 @@ export function createTexture(
gl.TEXTURE_WRAP_T,
gl[_getTextureWrap(wrap.y || wrap)],
);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);

if (data) {
// Upload the image into the texture
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/video-effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ test('channelSplit red cyan', async (ctx) => {
);

// TODO: fix by taking the correct snapshots excluding the sides
expect(diffPixels).toBe(7680); // expect the 7680 pixels of the horizontal sides to be different
expect(diffPixels).toBe(7822); // expect the 7680 pixels of the horizontal sides to be different + 142 pixels of the gl.LINEAR filtering
});

test('channelSplit magenta green', async (ctx) => {
Expand Down

0 comments on commit 9528d2b

Please sign in to comment.