-
Notifications
You must be signed in to change notification settings - Fork 133
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 iOS NativeCamera texture pixel format #1125
Merged
docEdub
merged 21 commits into
BabylonJS:master
from
docEdub:220825-webcam-video-texture--arc-on-2
Sep 6, 2022
Merged
Fix iOS NativeCamera texture pixel format #1125
docEdub
merged 21 commits into
BabylonJS:master
from
docEdub:220825-webcam-video-texture--arc-on-2
Sep 6, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Converted this to a draft because it's not up to date with Alex's latest changes. I'm not 100% happy with it yet but I'd like to get some eyes on it to make sure I'm not doing something dumb. |
ryantrem
reviewed
Aug 26, 2022
# Conflicts: # Plugins/NativeCamera/Source/Apple/NativeCameraImpl.mm
Alex-MSFT
reviewed
Aug 30, 2022
Alex-MSFT
reviewed
Aug 30, 2022
Alex-MSFT
reviewed
Aug 30, 2022
The "best" prefix in the `bestPixelFormat` local variable name only makes sense for the current iOS implementation. It doesn't make sense on macOS since we're not selecting a "best" device. On macOS we're selecting the default device. This change updates the local variable name so it makes sense for the current implementation on both iOS and macOS.
This is now working for macOS again and is ready for merge if there are no more changes needed. |
ryantrem
reviewed
Aug 31, 2022
ryantrem
reviewed
Aug 31, 2022
Alex-MSFT
reviewed
Aug 31, 2022
Alex-MSFT
approved these changes
Sep 2, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The BJS side creates the texture and specifies the format (as RGBA8, in NativeEngine.createDynamicTexture), and then the native side overrides the texture handle in the Graphics::Texture, but the other properties (including format) are not updated, so the format (BGRA8) is incorrect, and operations like readPixels won't work.
This change fixes the issue by using a shader to convert the camera's YpCbCr format into RGBA, similar to how it's done in XR.mm.
Related issue
#1107