GDevelop icon indicating copy to clipboard operation
GDevelop copied to clipboard

Panel Sprite render issue

Open Oxey405 opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

Describe the bug

As described in #6210 there is an issue in how the panel sprites are rendered when scaled You can observe some artifacts on the following screenshot took at 0.5 zoom image The artifacts seem to depend on the position of the camera...

Steps to reproduce

  1. In a GDevelop project create a PaneSprite with a repeating texture (don't stretch center)
  2. Move the camera around and observe the artifacts I have made an example project to better explore thie issue 9PatchBugExemple.zip

GDevelop platform

Desktop

GDevelop version

5.4.213 // latest

Platform info

No response

Additional context

No response

Oxey405 avatar Oct 06 '24 12:10 Oxey405

Hi @Oxey405,

thanks for taking the time to report this. Here is my conclusion after a bit of investigation:

  • The issue happens only if the resource is not smoothed;
  • The issue does not happen with stretched panels (only repeating ones, aka as tiling sprite);
  • The issue happens in the scene editor as well (at least this is consistent);
  • This seems to be linked to the clampMargin parameter of the PIXI TilingSprite

With this parameter set at values around 5-10, the glitches appear when the view is "dezoomed": the greater the parameter, the more you have to zoom out for them to appear. But, with this range of values, the texture is affected.

I'm not sure how to continue with this. Maybe we should drop the current rendering methods (patchwork of sprites and tiling sprites) and use a tilemap instead (this issue does not seem to appear with tilemaps).

AlexandreSi avatar Oct 07 '24 10:10 AlexandreSi

Hi @Oxey405,

thanks for taking the time to report this. Here is my conclusion after a bit of investigation:

  • The issue happens only if the resource is not smoothed;
  • The issue does not happen with stretched panels (only repeating ones, aka as tiling sprite);
  • The issue happens in the scene editor as well (at least this is consistent);
  • This seems to be linked to the clampMargin parameter of the PIXI TilingSprite

With this parameter set at values around 5-10, the glitches appear when the view is "dezoomed": the greater the parameter, the more you have to zoom out for them to appear. But, with this range of values, the texture is affected.

I'm not sure how to continue with this. Maybe we should drop the current rendering methods (patchwork of sprites and tiling sprites) and use a tilemap instead (this issue does not seem to appear with tilemaps).

Yes I think this pretty much sums up the technical part... @Bouh suggested it might be a PIXI-relared issue so I'll try to replicate it using just PIXI to see if it's about gdevelop's implementation or PIXI itself

Oxey405 avatar Oct 07 '24 10:10 Oxey405

Yes I think this pretty much sums up the technical part... @Bouh suggested it might be a PIXI-relared issue so I'll try to replicate it using just PIXI to see if it's about gdevelop's implementation or PIXI itself

I think that's a good idea. It would be a great starting point to report something to them if the issue actually comes from them.

AlexandreSi avatar Oct 08 '24 08:10 AlexandreSi