Some sprites tiling into tiny grid in packaged version only
I am using Paper2D sprites to render platforms in my game. It works perfectly fine when playing in the editor, but as soon as I use the Launch button or package the game and test it, certain sprites start rendering weirdly.
It seems the texture is being tiled many many times for some reason. See http://blay09.net/files/ludum/ld32/VisualGlitches/issues.png This is how it looks when playing from editor: http://blay09.net/files/ludum/ld32/VisualGlitches/main.png
The sprites are using the default MaskedUnlitSpriteMaterial and it only happens for some of them. This happens for both orthographic and perspective cameras. All rendering settings and sprite/texture properties are left on their defaults.
I've added an asset that's broken for me and one that's working fine in the packaged version here: http://blay09.net/files/ludum/ld32/VisualGlitches/ (Amplifier is broken, ConductiveLayer works)
asked Apr 21 '15 at 02:53 PM in Bug Reports
I think I've isolated what the issue is and I'm afraid that I don't have a good workaround without a source modification. It is a race condition between texture and sprite loading during cooking, as the ConditionalPostLoad call doesn't block for the texture when running the cooker as a separate commandlet like it does when run from the editor. This means that the bug shouldn't show up when you use Launch On, which defaults to cook-in-editor, but will show up when packaged via Package or UFE.
I've filed a ticket UE-14171 and I'll get that fixed for 4.8. The full fix will be to get size via a different mechanism, but as a quick hack you can try skipping the resizing code by changing UPaperSprite::NeedRescaleSpriteData() to always return false.
Cheers, Michael Noland
Follow this question
Once you sign in you will be able to subscribe for any updates here