amethyst / grumpy_visitors

🧙‍♂️🧙‍♀️ A prototype of a top-down EvilInvasion-like 2D arcade/action (with co-op!)
https://mvlabat.github.io/
MIT License
77 stars 13 forks source link

Blank screen #58

Closed sunwukonga closed 4 years ago

sunwukonga commented 4 years ago

I've compiled gv_client with and without --release and the screen is always blank.

On the cmdline, the following happens if I blindly click around to presumably hit the "Single player" as defined in main_menu.ron:

[INFO][gv_game::states::loading_state] LoadingState started                                                                                                             
[INFO][gv_game::states::menu_state] MenuState started                                                                                                                   
[INFO][gv_game::states::playing_state] PlayingState started

There is no sound. An F11 doesn't toggle fullscreen.

Any idea why this might be happening? I've checked out older commits to see if they worked, but the very earliest have different issues, and from roughly commit 0782772 it compiles but there's still a blank screen. All other showcase games work for me: evoli, pong, space-menace, space_shooter_rs.

mvlabat commented 4 years ago

Hi! Thanks for reporting the issue. I believe @ab0v3g4me has told me about the exact same problem you've got too. Could you tell me your OS and the graphics card you're using?

Unfortunately, as I can't reproduce it myself, it's quite tricky for me to debug it... May I ask you to build the game with commenting out every plugin, except for RenderToWindow and RenderUi? At least this will help to make sure that nothing overlaps the UI.

Also a RenderDoc capture might help to investigate the problem. If you upload your capture while in the menu state, I could compare it to mine and probably see where it goes wrong

mvlabat commented 4 years ago

There is no sound

Yeah, this is how it should be atm :)

On the cmdline, the following happens if I blindly click around to presumably hit the "Single player"

Just to clarify, you don't see anything on the screen after that either, right? Neither terrain texture, nor main character, nor spell missiles

sunwukonga commented 4 years ago

Yes, it's blank from start to finish. The only way to tell something is happening is from the [INFO] messages.

Disabling all plugins down to RenderToWindow and RenderUi still shows only a blank screen.

OS: Archlinux 5.6.10-arch1-1 #1 SMP PREEMPT Sat, 02 May 2020 19:11:54 +0000 x86_64 GNU/Linux Video: VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)

There are no error messages appearing in journalctl, and nothing appearing on the terminal that would indicate an error.

The diagnostic log from RenderDoc doesn't show up any unique errors or warnings that don't show up for Evoli.

diag.log

sunwukonga commented 4 years ago

Being on Arch I did have trouble with the linked shaderc, so I pull it as a dependency and build from source with this in .bins/client/Cargo.toml:

[features]
default = ["shaderc/build-from-source"]

[dependencies]
...
shaderc = "0.5.1"
shaderc-sys = "0.5.1"

But it compiles fine.

mvlabat commented 4 years ago

So it seems like it affects Linux users of Intel graphics cards... Got 2 reports already.

Could you also make a capture with RenderDoc and upload it here? https://renderdoc.org/docs/how/how_capture_frame.html

After you launch the app just press "Capture Frame(s) Immediately" image image

And I think it's best if you enable all the plugins back before capturing.

Thank you!

erlend-sh commented 4 years ago

Is this specific to Grumpy Visitors or should it be elevated to an Amethyst Engine issue?

mvlabat commented 4 years ago

@erlend-sh so far it looks like Grumpy Visitors specific. As @sunwukonga has mentioned, every other showcase game works for him

sunwukonga commented 4 years ago

The raw capture shows a blank black screen, however loading those captures and inspecting in the textures tab shows that everything seems to be rendering properly behind.

capture1 capture2 capture3

sunwukonga commented 4 years ago

I also tested turning off OpenGL rendering completely with the environment variable LIBGL_ALWAYS_INDIRECT=true in renderdoc. Exactly the same response as the images above.

sunwukonga commented 4 years ago

I found the solution in my particular case.

In bins/client/src/main.rs:

RenderingBundle::<DefaultBackend>::new()
    .with_plugin(
        RenderToWindow::from_config(display_config)
            .with_clear([0.0, 0.0, 0.0, 1.0]),
    )
    ...

For whatever reason, on my system, RenderToWindow requires a background color (even if it's just black) to work.

Does anyone have any insight into why that would be the case?

mvlabat commented 4 years ago

Great to know, thanks for investigating! I'll make a PR to fix this for everyone then. I think we should also provide a default clear colour by Amethyst itself

sunwukonga commented 4 years ago

Even a transparent background works.

    .with_clear([0.0, 0.0, 0.0, 0.0]),

Ergo, "a default clear colour by Amethyst itself" would also resolve the issue for me.