amethyst / sheep

Modular and lightweight spritesheet packer 🐑
Other
89 stars 12 forks source link

Textures overlap #29

Open pum-purum-pum-pum opened 4 years ago

pum-purum-pum-pum commented 4 years ago

My texture atlas looks like this in some cases Screenshot from 2019-10-16 17-53-24 Probably it's due to I'm using too big textures(I will write here when I resize them).

happenslol commented 4 years ago

That's weird. Can you post the dimensions of the textures you're using, or just post the smallest set of textures the problem can be reproduced with? I'm assuming you're using MAXRECTS?

pum-purum-pum-pum commented 4 years ago

imgs_subset.zip MAXRECTS inside my packer(UPD: I meant not sheep's packer, but my cli), yes. The same for simple packer with CLI (checked with bigger max_height max_width too)

dimentions:

(333, 27)
(667, 53)
(267, 267)
(133, 133)
(1333, 1333)
(333, 333)
(267, 267)
(267, 267)
covercash2 commented 4 years ago

I wrote a function for detecting overlaps a while ago and deleted it for some reason after I squashed my own version of this bug. I'll look into it again tonight

pum-purum-pum-pum commented 4 years ago

Also for MAXRECTS it looks like bins are not working correctly (overlaps are there too both for simple and maxrects) Screenshot from 2019-11-03 21-13-19

pum-purum-pum-pum commented 4 years ago

Also another bug. I have out of bounds panic error for simple packer on line:

buffer[buffer_idx] = sprite.bytes[sprite_idx];

in sprite.rs Images subset to reproduce out_of_bound.zip

happenslol commented 4 years ago

Thanks for documenting those errors! I'll look into it as soon as I have the time (which will probably be around next weekend).

pum-purum-pum-pum commented 4 years ago

Ok, thank you! I just made temporal hack with piston's texture packer for myself. Mb someone will find it useful kludge_for_mimic_sheep_api

mashedcode commented 4 years ago

A temporary workaround would be to use jorgebastida/glue and transform the json it outputs to amethyst structs.