Jump to content

PIXI.mesh.NineSlicePlane is missing pixel grid on retina screen


Recommended Posts

There are two sequential frames from animation, where dragon sprite and attached piece of UI moves from up to down. Left one is normal and right one is bit broken. Sprite itself (PIXI.extras.AnimatedSprite) and number 8 (PIXI.extras.BitmapText) looks perfectly fine through all animation, but HP bar background (PIXI.mesh.NineSlicePlane), HP bar itself (PIXI.Graphics) and number background are not hitting pixels perfectly sometimes and animation looks jaggy.



PIXI.settings.MIPMAP_TEXTURES is false.

roundPixels is true.

As I said, I have retina screen, so resolution is 2. I'm not sure if issue is reproduced on regular screen. I've searched through the docs but couldn't find any special settings for PIXI.mesh. I can make same UI from basic sprites of course, but NineSlicePlane is so much more convenient.

Link to comment
Share on other sites

I dont see any round-related code in mesh in v4. https://github.com/pixijs/pixi.js/tree/v4.x/src/mesh and in graphics too: https://github.com/pixijs/pixi.js/tree/v4.x/src/core/graphics . Also, make sure that screen size is less than 4096 and CSS width/height that pixi set corresponds to canvas width/height. 

Link to comment
Share on other sites

I've investigated a bit further, tried different setups and resolutions. Issue is reproduced even when resolution is 1. Reproduced with basic Mesh too. CSS seems fine and screen is less than 4096.

Both Sprite and Mesh use correct step when animating (one logical pixel), so none of them are actually missing grid, but they are kinda out of sync. It's interesting that Graphics (green bar) moves in sync with sprite, even when hierarchy is AnimatedSpriteContainer -> Mesh -> Graphics. It's like Mesh positioned properly as container, but rendering is off for some reason. Will try to research more.

Link to comment
Share on other sites

I suggest to make a demo at pixiplayground.com that way: create a renderTexture with resolution=2 , render something there, then render it on screen inside a sprite with big scale (x5 or so) , post it in https://github.com/pixijs/pixi.js/issues , that way we'll attract the rest of pixijs team.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...