Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation broken on WebGL if TextureAtlas has multiple textures #1207

Open
CodeAndWeb opened this issue Oct 17, 2023 · 9 comments
Open

Animation broken on WebGL if TextureAtlas has multiple textures #1207

CodeAndWeb opened this issue Oct 17, 2023 · 9 comments
Labels

Comments

@CodeAndWeb
Copy link

When an animated sprite is created with createAnimationFromName() on a TextureAtlas which has multiple textures ("multi-pack"), all animation frames must be placed on the first texture. Otherwise the animation is broken:

broken-animation

To Reproduce

  1. git clone -b multipack-broken https://github.com/CodeAndWeb/melonjs-sprite-sheet-example.git
  2. npm run dev
@CodeAndWeb CodeAndWeb added the Bug label Oct 17, 2023
@obiot
Copy link
Member

obiot commented Oct 17, 2023

oh ! interesting ! thank you for reporting it !

@CodeAndWeb
Copy link
Author

Same problem when creating a single sprite with atlas.createSpriteFromName("spritename"). Is multi-pack supported at all? or am I doing something wrong?

@obiot
Copy link
Member

obiot commented Oct 17, 2023

well it is supposed to be supported, but I guess either with limitations, or we had some regression in the last few versions, I'll definitely look into it

@obiot
Copy link
Member

obiot commented Oct 18, 2023

Hi, so I cloned your git, executed it and ...... it's just working here ....
Oct-18-2023 09-44-31

is there something I'm missing to reproduce the bug ?

@CodeAndWeb
Copy link
Author

Have you checked out the "multipack-broken" branch?

@obiot
Copy link
Member

obiot commented Oct 18, 2023

of course it did not.... sorry, I did not realize there was a specific branch for it. Saw it now and indeed it's not working properly

@customautosys
Copy link
Contributor

Dear Olivier,

Facing same problem on WebGL:

bildo

Canvas is working fine:

bildo

Have already updated my package to the latest melonJS release

@obiot
Copy link
Member

obiot commented Dec 30, 2023

wow thank you ! I was really scratching my head with this one, looking at the logic implementation of the multi-texture TextureAtlas support, and could not find what was wrong. Now thank to you, I know that the issue is with the WebGL renderer, and now I know where to look !

@obiot
Copy link
Member

obiot commented Dec 31, 2023

I managed to pin point the issue, it's actually a regression following that change : 16c5d3c

@obiot obiot changed the title Animation broken if TextureAtlas has multiple textures Animation broken on WebGL if TextureAtlas has multiple textures Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants