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

Fix rgb camera for mac #6

Merged
merged 5 commits into from
Dec 19, 2024
Merged

Conversation

JakobSpahn
Copy link

@JakobSpahn JakobSpahn commented Nov 13, 2024

What changes do you make in this PR?

Make the RGBCamera work on MacOS:

python -m metadrive.examples.drive_in_single_agent_env --observation rgb_camera

Changes for MacOS:

  • Request only 8-bit colors
  • Use GLSL 330
  • Use PBR render pipeline

Required for completing: commaai/openpilot#33207

- only 8-bit colors for mac
- use glsl 330 for mac
@JakobSpahn
Copy link
Author

JakobSpahn commented Nov 15, 2024

@maxime-desroches Should this be merged into main and then to minimal, or straight into minimal?

@adeebshihadeh
Copy link

@maxime-desroches can you check this out? Looks like it's holding up macOS metadrive support

@maxime-desroches
Copy link

Thanks for the PR. Once this is cleanup, I will merge this into main and create the new minimal wheel (and re-open your openpilot PR)

@@ -39,15 +40,17 @@ def _setup_effect(self):
self.manager = FilterManager(self.buffer, self.cam)
fbprops = p3d.FrameBufferProperties()
fbprops.float_color = True
fbprops.set_rgba_bits(16, 16, 16, 16)
# fbprops.set_rgba_bits(16, 16, 16, 16)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing this?

@@ -265,7 +265,7 @@ def _setup_tonemapping(self):

fbprops = p3d.FrameBufferProperties()
fbprops.float_color = True
fbprops.set_rgba_bits(16, 16, 16, 16)
# fbprops.set_rgba_bits(16, 16, 16, 16)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing this?

Comment on lines 107 to 108
loadPrcFileData("", "color-bits 8 8 8")
loadPrcFileData("", "alpha-bits 8")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16 bits RGBA works fine on my mac. What are you testing this on?

@JakobSpahn
Copy link
Author

Thanks for the review. Yes, manually setting 8-bit RGBA for Mac is indeed not needed anymore with the PBR pipeline working again, I missed that.

@maxime-desroches maxime-desroches merged commit 570da04 into commaai:main Dec 19, 2024
12 of 14 checks passed
maxime-desroches added a commit that referenced this pull request Dec 19, 2024
* fix rgb camera for mac

- only 8-bit colors for mac
- use glsl 330 for mac

* macos 4x antialiasing

* no more need to enforce 8-bit colors on mac

* more samples

* what is this, 1990?

---------

Co-authored-by: Maxime Desroches <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants