Yes. Bundles are OK and on Windows bundle in Renderdoc everything is rendered, it’s just not visible in the build from Editor.
Also, it is not a matter of wrong z-ordering as I checked this and the sprite was not visible (in Project->Build ofc) even if there was only this particular one in the scene.
Seems like the issue is with handling more than one atlas (or few - there is no number of atlases I could say is always the same) or some atlases being “broken” for some reason. In particular projects, when this happens it regards always one particular atlas. When you move the images from that atlas to other one - everything works. I don’t know why in different projects this happens or not, depending on amount of atlases used in the game.
Notice also that one strange behavior, that was described in the linked thread - when you switch screen (with Monarch) and some other textures/atlases are loaded for this scene, the sprite in the screen below is instantly becoming visible (example of this is described thoroughly in that thread and there are gifs showing it).
Like adding more textures on the screen is magically helping solve this issue.
So you are able to cause the atlases to display on build by changing them or replacing them and/or adding more? This is a bit confusing for me, as you might understand. Not knowing exactly how to make this work is really making me feel skeptical to continue using this game engine. I have learned Lua as my main programming language and finding Defold got me super excited to get working on some games. But if there’s something I can’t control, like the sprites disappearing (which seems like it’s something that shouldn’t be a problem) for no clear reason, I am worried that my efforts will be wasted.
Recently I sold my dedicated GPU, so I temporarily have to use iGPU (Intel UHD Graphics 630). The result is that I got the same bug
I confirm that it happens only if you do Project/Build. I want to help fixing the issue, but the bug doesn’t appear when you launch the Defold game through RenderDoc. Hm.
Yep, exactly, that’s why when I reported it the first time it got stuck
Yes - for example:
I have sprites of main character in one atlas hero.atlas
I have sprites of background art in other atlas background.atlas
When it happens that for hero.atlas the bug occurs - I move sprites from hero.atlas to background.atlas and it is working.
Simply, if I move images from “broken” atlas to another, sprites are visible correctly.
This is not a satysfying workaround of course, I do have a proper system for packing sprites in atlases and when such bug occurs for some atlas, it is not cool
Thanks! I can try to use this as a temporary workaround. I see that this wouldn’t be such a great way to make it work, since it doesn’t explain what the issue is. But much appreciated!
I’ve been going through the default render script and just fiddling around with the materials and such, trying to see if I can at all recreate a scenario that would cause all sprites to appear. I haven’t made any sure findings yet, but it seems that every once in a while, all of the sprites will in fact render properly. When that happens, I close the build, and try to build again without changing anything, but then only a few sprites show up again.
First I noticed that the tags in the “tile” material and “sprite” material both have the same tag, “tile”. I tried changing the tags and separating the sprite material with its own tag, “sprite”. Then I just changed accordingly in the default render script by adding a separate predicate named “sprite” also. Then inside update() I put in render.draw(self.sprite_pred). It fooled me! I got the build running and voila! All of the sprites were showing. I was so excited but then I tested it again… The sprites were gone again .
This. I think it’s the sprite vector position? Maybe something completely different, I’m not sure. But what I do know is that if I go into the script and change this line:
and change the 1.0 to something higher, (Which seems to shrink everything) I am able to see the other sprites every time. Here are some screenshots to demonstrate:
I recall when I just started (which was like 4-5 days ago) I realized there was something covering the tilemap I was working on. I’m sorry, I can’t remember how to replicate this. But I will keep trying to so I can show you all that there is possibly some kind of “cover” that’s covering the sprites. Maybe it’s a clipping area?
Do you guys have any other ideas based on this discovery?
Edit: I think it’s actually the view projection, not vector position.
This new info reaffirms my belief that it’s a shader issue.
My guess is that the shader generated by the editor is slightly different from the one produced by bob.jar. Not the code you see, but the preamble that we put at the top of the shader.
Thank you all. I appreciate every consideration into this matter. This is the first time I’m working with 2d games built in a 3d environment, so my understanding is not as good as it should be for working through this. I can’t wait to see what I can make using Defold!
Also I think the documentation is well done. Initially I didn’t realize how much information had been made available to users of this game engine. But even explaining how Defold processes visuals, from the perspective of the camera, to the pixels being rendered. It’s not just you (3?) working on this, is it?
Hi, this is the project which reproduces the described issue. I also attached 2 screenshot (Windows release build and Html release build). The same issue is during Ctrl + B (debug) run. I have Intel UHD Graphics 630.
It turned out that I had outdated drivers for the UHD 630 GPU. However, Intel Driver Support Assistant reported to me that all my drivers were the latest and “up to date”. So I dug into the Intel website, found the latest ones, and it fixed this issue for both my PCs (both with UHD 630).
Then I installed all of the available drivers one by one to found out when Intel had fixed the bug:
The project has 4 different atlases with the same sprite (the built-in “logo_256.png”). It displays 2 sprites + 2 GUI boxes using standard materials and 2 sprites + 2 GUI boxes sprites using custom materials that fill sprite with red colour when alpha is less than 1.0:
Thanks. One difference I found when I started looking into this is that a normal build (cmd+b) from the editor only generates one set of shaders, while a bundle (which uses Bob) generates shader code for both old and new open gl versions.
One thing which surprised me was the missing sprite (third from the left) in the windows release bundle. Any idea why?
Wow! Thanks a lot! I just trusted that Windows could find the latest driver software for me, but I tried this and much to my surprise, it actually worked.
The driver version I was using before, I am not sure. But now it has been updated to 27.20.100.8681 which works great.
@MinchukSergei, @Pawel, could you please check again the version of your iGPU drivers?
I don’t think that the issue was related to shaders. Shaders ran well because all 4 sprites in the bottom were filled with red colour in all screenshots.
In the windows release bundle, the “atlas3” texture wasn’t properly loaded (or something like that, I don’t know) and the third line was missing.