New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black screen/shader issues on MacOS #54

Open
WEREMSOFT opened this Issue Dec 22, 2018 · 23 comments

Comments

5 participants
@WEREMSOFT
Copy link

WEREMSOFT commented Dec 22, 2018

Running on osX mojave. Macbook pro retina. Download from GIT and run

cargo run --example hello_world

Compiling tetra v0.2.1 (/Users/pabloweremczuk/Documents/Proyectos/rust/tetra)
Finished dev [unoptimized + debuginfo] target(s) in 6.41s
Running target/debug/examples/texture
OpenGL Device: AMD Radeon R9 M370X OpenGL Engine
OpenGL Driver: 2.1 ATI-2.4.9
OpenGL Vendor: ATI Technologies Inc.
Swap Interval: VSync
Error: OpenGl("ERROR: 0:1: '' : version '130' is not supported\n")

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 22, 2018

Someone on Discord ran into this same issue yesterday - after doing a bit of further research, it sounds if you don't force OpenGL to use the core profile on MacOS, it defaults to OpenGL 2.1 🤔

An easy way to test whether this is the cause - do the examples start working if you set the TETRA_OPENGL_FORCE_CORE_PROFILE environment variable to 1?

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 22, 2018

@VictorKoenders: Could you also try setting the TETRA_OPENGL_FORCE_CORE_PROFILE env variable to 1 when you get chance? It sounds like I may need to force 3.2 core profile by default to be able to support MacOS (at least without adding a load of GL extensions), but given that your drivers were reporting 3.0 by default, I want to double check that I'm not going to break things on your end!

@VictorKoenders

This comment has been minimized.

Copy link
Contributor

VictorKoenders commented Dec 22, 2018

I'll try that tomorrow evening (20-24 hours from now) once I get my linux laptop back. It's currently in the hackerspace and I am not.

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 22, 2018

Thanks :)

@xithiox

This comment has been minimized.

Copy link

xithiox commented Dec 22, 2018

I still got the same error message even when setting the environment variable.

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 22, 2018

@xithiox Could you try running an example on the core-profile branch that I just pushed? I've made Tetra unconditionally force core profile there, so that should rule out any issues with the environment variable being read.

@xithiox

This comment has been minimized.

Copy link

xithiox commented Dec 23, 2018

@17cupsofcoffee Just tried it out. The examples do run now on the core-profile branch but they aren't displaying anything—just a black screen.

@WEREMSOFT

This comment has been minimized.

Copy link

WEREMSOFT commented Dec 23, 2018

Same result: Black screen on core-profile branch.

I'm in gmt+1. Just in case you need more tests.

@VictorKoenders

This comment has been minimized.

Copy link
Contributor

VictorKoenders commented Dec 23, 2018

Wouldn't it be easier just to target 2.1.0 instead of 1.3.0?

That seems to be what apple likes: link

The steam summary suggests that most people support DX10 or higher (about 99%). According to this stackexchange post, that's comparable to OpenGL 3.0.

Alternatively, we can make different shaders per OS, as long as we use the functionality that all of them support, this should work.

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 23, 2018

Don't get mixed up between the shader language versions and the OpenGL versions - it's 3.2 we target, not 1.3 :p

Long term I might try to support 2.1, but it'll require enabling some GL extensions (e.g. framebuffers weren't added to core until 3.0, and Tetra uses them for screen scaling). Will have to do some research on that.

I'll look into the black screen issue today - the shaders don't do anything particularly complex, so hopefully getting them working on Mac won't be too hard.

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 23, 2018

@xithiox @WEREMSOFT - Try pulling the latest changes to core-profile and see if it works now. I've bumped the shader versions to #version 150 core, which is the version that corresponds to OpenGL 3.2. That's also the shader version that GGEZ uses, and they seem to have working Mac support, so something is probably broken in my code if this doesn't work 😅

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 23, 2018

@xithiox @WEREMSOFT - Aah, actually - I just realized the core-profile doesn't have the fix from #52 in it, and that was also causing black screens. I've merged those changes in - hopefully one or both of those fixes will get stuff working.

@WEREMSOFT

This comment has been minimized.

Copy link

WEREMSOFT commented Dec 23, 2018

Sadly not. I checked out I have this after execute git log:

commit 0c84cf0 (HEAD -> core-profile, origin/core-profile)
Merge: e2dff24 ac1b340
Author: Joe Clay 27cupsofcoffee@gmail.com
Date: Sun Dec 23 12:19:36 2018 +0000

Merge branch 'master' into core-profile

commit e2dff24
Author: Joe Clay 27cupsofcoffee@gmail.com
Date: Sun Dec 23 12:03:52 2018 +0000

Bump shader versions to 150

I still have a black window. I moved the window around and resize because other game engines like SFML have this bug, but still no luck.

Tested with cargo "hello_world" and "animations"

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 23, 2018

Agh :( Well I'll merge the core profile changes into master, since it seems like they're a requirement to get anything to run on Mac, even if it's just a black screen. Will keep trying to figure out what's causing the issues, although I don't know how much time I'll have this week cause of the holidays.

@WEREMSOFT

This comment has been minimized.

Copy link

WEREMSOFT commented Dec 23, 2018

You have me on twitter and here. Drop me a line if you want me to test something.

Cheers

@VictorKoenders

This comment has been minimized.

Copy link
Contributor

VictorKoenders commented Dec 27, 2018

0.2.2 still works on my machine with mesa drivers

@gagan0723

This comment has been minimized.

Copy link

gagan0723 commented Dec 29, 2018

Is it fixed?
I get the same error:

Finished dev [unoptimized + debuginfo] target(s) in 0.14s                                       
     Running `target/debug/examples/hello_world`
OpenGL Device: AMD Radeon Pro 560X OpenGL Engine
OpenGL Driver: 4.1 ATI-2.4.9
OpenGL Vendor: ATI Technologies Inc.
Swap Interval: VSync
Error: OpenGl("ERROR: 0:1: \'\' :  version \'130\' is not supported\nERROR: 0:2: \'\' :  #version required and missing.\n")

Thanks ☺️

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 30, 2018

@gagan0723 Which OS version/Tetra version are you using? There's still issues on Mac, but I was under the impression we could at least get the shaders to compile now...

@gagan0723

This comment has been minimized.

Copy link

gagan0723 commented Dec 30, 2018

OS: macOS
Tetra: 0.2.2

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 30, 2018

Thank you for the info - the tricky bit for me is that I don't have access to a Mac, so it's very hard to diagnose these kinds of issues (especially when it seems like other Mac users are getting an entirely different problem with black screens rather than shader compilation) 😞 If I have any ideas for a fix, I'll be sure to let you know.

@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Jan 3, 2019

The new release (0.2.3) has a couple of compatibility fixes included - fingers crossed it resolves some of these issues...

@gagan0723

This comment has been minimized.

Copy link

gagan0723 commented Jan 3, 2019

Same issue.

▶ fork/tetra (master ⁚ ) (🦀 v1.31.0) cargo run --example hello_world
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s                                       
     Running `target/debug/examples/hello_world`
OpenGL Device: AMD Radeon Pro 560X OpenGL Engine
OpenGL Driver: 4.1 ATI-2.4.9
OpenGL Vendor: ATI Technologies Inc.
Swap Interval: VSync
Error: OpenGl("ERROR: 0:1: \'\' :  version \'130\' is not supported\nERROR: 0:2: \'\' :  #version required and missing.\n")

▶ fork/tetra (master ⁚ ) (🦀 v1.31.0) 

Git log:

commit bec85347d1af994f11c6383c62d732ae5166caf6 (HEAD -> master, tag: 0.2.3, origin/master, origin/HEAD)
Author: Joe Clay <27cupsofcoffee@gmail.com>
Date:   Thu Jan 3 01:24:42 2019 +0000

    Release 0.2.3

commit d62f30d424f50003f353757e096ca8ba3f32b81b
Author: Joe Clay <27cupsofcoffee@gmail.com>
Date:   Thu Jan 3 00:28:24 2019 +0000

    Update CHANGELOG.md [skip-ci]
@17cupsofcoffee

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Jan 3, 2019

Agh, how annoying :(

@17cupsofcoffee 17cupsofcoffee changed the title Error: OpenGl("ERROR: 0:1: \'\' : version \'130\' is not supported\n") Black screen/shader issues on MacOS Jan 8, 2019

@17cupsofcoffee 17cupsofcoffee pinned this issue Jan 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment