Skip to content
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

"Tutorial 2.2 - Camera" don't work on macos #1863

Closed
thenuts opened this issue Dec 27, 2023 · 9 comments · Fixed by #1991
Closed

"Tutorial 2.2 - Camera" don't work on macos #1863

thenuts opened this issue Dec 27, 2023 · 9 comments · Fixed by #1991
Labels
bug Something isn't working
Milestone

Comments

@thenuts
Copy link

thenuts commented Dec 27, 2023

Summary

"Tutorial 2.2 - Camera" works as expected on Windows, but it seems to have a depth detection problem on my Mac.

Steps to reproduce

  • Platform: Desktop
  • Framework Version: .NET 8
  • API: OpenGL
  • API Version: OpenGL Version: 4.1 Metal - 88
  1. Just run "Tutorial 2.2 - Camera" on Mac

Comments

I am testing in an Apple M1 Pro
macOS: Sonoma 14.2.1

Screenshot 2023-12-27 at 12 16 49
@thenuts thenuts added the bug Something isn't working label Dec 27, 2023
@Perksey
Copy link
Member

Perksey commented Dec 27, 2023

Looks like the PreferredDepthBufferBits aren’t set.

@thenuts
Copy link
Author

thenuts commented Dec 27, 2023

I manually set it with
options.PreferredDepthBufferBits = 24;
before the window.create with no change in behaviour. also, why is this not needed for Windows but would be needed for Mac?

@Perksey
Copy link
Member

Perksey commented Dec 27, 2023

Oh, in which case I’ll put this down to Apple’s terrible OpenGL support. PreferredDepthBufferBits being null means that the depth buffer is in an entirely undefined state, which in my experience leads NVIDIA to set up a sensible depth buffer but AMD and other implementations tend to interpret this as “oh well we don’t need a depth buffer then”.

@tilkinsc
Copy link
Contributor

tilkinsc commented Dec 27, 2023

I wonder if the depth function is inversed. OpenGL is probably in a weird state. (I know mac doesnt play nice from what I've seen in PPSSPP)

@MichaelMay81
Copy link

Looks like the PreferredDepthBufferBits aren’t set.

I had the same problem on linux and this solved it. Thanks!!!

@Perksey Perksey added this to the 2.X milestone Feb 24, 2024
@WoozChucky
Copy link

Can confirm this also happened on MacOS M1 Pro. PreferredDepthBufferBits had to be set. Maybe the example should include the, or have some sort of comment regarding this weird behaviour.

@tvardero
Copy link

tvardero commented Mar 14, 2024

Can confirm this appears for Windows 11 Pro 22631.3296 with Silk.NET 2.20.0
Tutorial 2.1 Coordinate system

GPU is integrated AMD Radeon, CPU is Ryzen 5 5500U

image

@tvardero
Copy link

tvardero commented Mar 14, 2024

Also on Windows 10 Pro 19045.4046 (GPU integrated AMD Ryzen 7 4700U)
Also on Manjaro Linux x86_64 (GPU: Intel CometLake-H GT2 [UHD Graphics])

The problem is global

This fixes:

var windowOptions = WindowOptions.Default with
{
    // ...
    PreferredDepthBufferBits = 24,
};

@Perksey
Copy link
Member

Perksey commented Mar 20, 2024

In response to user feedback we've changed the default behaviour to always use 24/8 if both preference properties are null (as they are by default), see #1991

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants