Did some testing, both with the example and my primary project. Seems to work beautifully now. As well, your other fixes this update actually helped with some stuff I was just going to work around. And that's good to know about the camera, I'll keep that in mind moving forward. I know I sound like a broken record, but seriously thank you for handling this so quickly, it helped with a massive headache :3
proaliasing
Recent community posts
Crazy timing, I was just putting together the example. Unfortunately, for some reason after the update, transparency doesn't seem work at all :C
Here's the example. Mind the comments, they're for the previous version:
Down arrow turns the camera around
1 spawns a cat in front of the 1 sign
2 spawns cats in front of the 2 sign (on the opposite side, behind the player)
3 key spawns an extra cat in front of the camera
Space offsets an object's U slightly.
Previously, if you started up the preview, then immediately spawn cats with 2, it did reproduce the bug when you turned around to look at them.
Switching the U also did indeed break everything as well.
However, I absolutely could not reproduce the layout switch bug, except under the very specific condition of spawning the extra cat, with a wait of 0 secs. And even then it was only for that image.
I tried it again in my actual project earlier (before the update, to be clear), and the bug also just... abruptly vanished. It still happened to a single object that spawns similarly to the extra cat in the example, but yesterday I swear switching between layouts broke all of them. I know I didn't touch the project or change anything because I immediately dropped it after making this post and haven't altered anything since.
Though, as I said; currently images don't seem to be loading with transparency at all. So that's the more pressing issue. Sorry to throw all this at you! I do appreciate it a lot.
I've been pulling my hair out over this one for the past four days, so I apologize in advance if this is a lot. If it's important to know, I'm exporting to nw.js, on Windows 10. Most of this was happening in the preview, and I only just tested the exported version to verify it's mostly the same. I'm not comfortable providing my project file, but if the problem isn't immediately intuitive I can make a quick example to demonstrate if requested.
The tl;dr is that loading textures from project files onto a billboard plane kills transparency if a camera isn't looking at it, or some other conditions are met.
What I'm trying to do is something like this:
Player enters room > Spawn characters (tiled backgrounds, plane behavior) > Set their mesh texture to one of many various images from the project files (decided by a bunch of irrelevant stuff)
It mostly works as expected, except as the title says, they'll lose transparency under some of the following conditions:
- If they load in when a camera isn't looking at them
- If anything anywhere alters any object's U/V ever
- If you switch to a camera that wasn't looking at them when they loaded in (oddly, switching back to the previous camera restores their transparency for that camera)
- If they load in when a camera that isn't a sprite with the camera behavior is looking at them (this one was inconsistent)
- If you do anything "weird" with the size of the object (also inconsistent)
- It doesn't seem to be related to the image's size or memory. It still happens with smaller images, and I'm able to get them all loaded in fully under ideal circumstances
Most frustratingly (and this is the wall that brought me here) if you switch layouts, it seems to just break all of them permanently.
When it happens, typically it seems like the image itself breaks. If I apply the same image to a different object, it will still lack transparency. I tried messing with the texture in various ways hoping to make it reload it properly. But once it's broken it's stuck like that except for...
I've found (as long as the layout hasn't ever changed) that destroying the object, spawning a new one, then setting the image "fixes" it if it's spawned again in ideal conditions (the player looking directly at it, no UV altered anywhere). I'm guessing because it unloads it entirely from the memory or something idk. The only exception is when switching layouts.
Strangely, the bug when switching layouts is slightly better after export, but some images still break permanently, and destroying the object no longer fixes that one specific object. It's very inconsistent.
You can probably tell, but an issue like this is way too low level and way over my head. I spent hours building a hacky line-of-sight system just to make sure they only load when they're on screen. Actually, everything I've been doing has been just trying to work around this in various janky ways, or desperately trying to figure out what I'm doing wrong. I thought I finally built a system that works around it, but this thing with the layout breaking all of them literally stopped my progress entirely.
Is using project files in this way just not supposed to work how I think it does? I'm using them for memory management and workflow reasons, because the images are too big and numerous for anything else to be practical. Is there a better way to handle this? Is it just a low level bug I can't do anything about? Am I making some common mistake? I'm begging for any kind of solution at this point.
Again, I apologize for the length and frustrated tone, I hope this is coherent enough. I'm trying to be as specific as possible in the hopes it'll help, but I'm also just at my wit's end with this problem. Please tell me there's just some odd setting I missed, or a different method to do this and it's not some kinda architectural wall.