Sprite Game Object is not rendering?

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 :sweat_smile:

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.

4 Likes

Yep, exactly, that’s why when I reported it the first time it got stuck :confused:

Yes - for example:

  1. I have sprites of main character in one atlas hero.atlas
  2. 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 :frowning:

3 Likes

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 :sweat: .

I just made a little discovery.

image

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:

image

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:

This was at 1.0:

and this was at 2.0:

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.

The .vp file is the vertex program and it is part of the material and shader of a visual component in Defold:

1 Like

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.

1 Like

So we should be able to compare the quite easily right?

Yes, e.g. let the engine printout the shader it uses for the sprites, e.g. from (graphics.cpp: GetShaderProgram() from res_vertex_program.cpp).

1 Like

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?

1 Like

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.



repro.zip (8.2 MB)

1 Like

Thanks. We’ll look into it this week and hopefully provide a solution soon!

2 Likes

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). :partying_face:

Then I installed all of the available drivers one by one to found out when Intel had fixed the bug:

Maybe it will be helpful to someone. At least, now I can quickly reproduce the issue :slight_smile:

5 Likes

Also, I made a clean repro project, just in case:
issue_missing_tex_igpu.zip (7.1 KB)

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:

How it should look if everything is ok:

On buggy Intel drivers:

  1. When I run the project from the IDE:
  2. When I run the release build for Win64:
  3. When I run the HTML5 build from the IDE:
4 Likes

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?

2 Likes

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. :face_with_hand_over_mouth:

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.

3 Likes

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.

1 Like

For me the repro project posted by @aglitchman is showing everything:
IDE:


Windows64 build:

Maybe Windows updated the driver in the meanwhile, I haven’t spotted the error in my main project too.
The latest installed drivers:

I couldn’t find any igfx_win_xxx.xxxx DCH drivers in System32/DriverStore - idk, is it normal?

1.2.186
Editor: 71d178069a8fa37a4a52d3b44b98bd7596197e4e
Engine: 1f748d5b0a84e8b5c58bf747e4c48d153ef77a52

3 Likes

@aglitchman, hi, sure. 26.20.100.6911 - driver version

1 Like

Oh. It would be best if you tried to update your drivers, seeing as Intel provides fresh iGPU drivers for a wide range of CPUs (manufactured in 2015 (Skylake) and newer).
Intel® Graphics – Windows® 10 & Windows 11* DCH Drivers - 30.0.100.9864

I hope that will help.

1 Like

thank you, I’ll try