question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

visual glitches in PIXI.TilingSprite from PIXI.Spritesheet

See original GitHub issue

Expected Behavior

PIXI.TilingSprite looking correct no matter from which source it was created.

Current Behavior

There are visual glitches (flickering) when moving a PIXI.TilingSprite that is created from a PIXI.Spritesheet that is created from an image for which mipmaps are generated which is the default for power-of-two sized images.

In the following screenshot the yellow lines in the middle (blue background) are looking wrong. In the provided “live” example those lines are flickering noticeably. The yellow lines on the left (red background) and the right (green background) are looking correct. screenshot

Possible Solution

Workaround 1: Use a non-power-of-two sized image for the sprite sheet.

Workaround 2: Disable mipmaps completely before creating anything: PIXI.settings.MIPMAP_TEXTURES = PIXI.MIPMAP_MODES.OFF

Both are only workarounds. I assume this has to be fixed within PIXI.TilingSprite.

Steps to Reproduce

Just open the provided example in any browser.

Environment

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:16

github_iconTop GitHub Comments

1reaction
ivanpopelyshevcommented, Jul 12, 2020

Of course I’ll review your stuff in detail! When i have enough time.

All those isseus were addressed in https://github.com/pixijs/pixi.js/pulls?page=2&q=is%3Apr+tilingsprite , 4 years ago, I remember how difficult it was, and to improve that thins will be really hard

Usually, those kind of issues in other renderers are answered as “Its WebGL. the feature is not supported, use full-sized textures.” 😉

1reaction
TeeTeeHaacommented, Jul 2, 2020

Some info has to be passed to texture.uvMatrix or tilingsprite.uvMatrix instance - clampOrigin has to be -0.5 or 0.5 depending on color of pixels are around your texture in spritesheet.

I tried out setting those attributes, with various different values, but without success. I would appreciate suggestions what I should do in my provided example to avoid the visual glitches (the flickering). I do not want to use any of the two workarounds I mentioned, because those have negative side effects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pixi.js - Tiling Sprite
basics. Basics · Container · Container Pivot · SpriteSheet Animation · Click · Tiling Sprite · Text · Graphics · Video · Render...
Read more >
PIXI.TilingSprite
A tiling sprite is a fast way of rendering a tiling image. Constructor. new PIXI.TilingSprite(texture: PIXI.Texture, width: number, height: number) → {} ...
Read more >
When loading images from a sprite sheet in PIXI.JS is the ...
On webGL, displaying the graphics is GPUs responsibility. So if the CPU is choking, when using webGL, I would be fairly sure myself, ......
Read more >
Visual glitch on v4 + WebGL + TilingSprite - Pixi.js
Hi guys, I developed a PixiJS rewriting of XMoto for the web ... I get a weird visual glitch using WebGL and TilingSprite...
Read more >
Pixi's docs - PixiJS API Documentation
PixiJS — The HTML5 Creation Engine. pixi.js logo. Discord npm version Node.js CI. This project aims to provide a fast lightweight 2D library ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found