4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.66k stars 844 forks source link

Panel Sprite render issue #7018

Open Oxey405 opened 6 days ago

Oxey405 commented 6 days ago

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

AlexandreSi commented 5 days ago

Hi @Oxey405,

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

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).

Oxey405 commented 5 days ago

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

AlexandreSi commented 4 days ago

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.