-
Notifications
You must be signed in to change notification settings - Fork 348
[Sample] [Graphics] UltraHDR x OpenGL shaders with SurfaceView brightness control #131
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
Conversation
samples/graphics/ultrahdr/src/main/res/layout/ultrahdr_with_graphics.xml
Show resolved
Hide resolved
gradle/libs.versions.toml
Outdated
@@ -124,6 +124,7 @@ androidx-work-runtime-ktx = "androidx.work:work-runtime-ktx:2.8.1" | |||
androidx-core-remoteviews = "androidx.core:core-remoteviews:1.0.0" | |||
androidx-glance-appwidget = "androidx.glance:glance-appwidget:1.0.0" | |||
androidx-glance-material3 = "androidx.glance:glance-material3:1.0.0" | |||
androidx-graphics-core = { group = "androidx.graphics", name = "graphics-core", version = "1.0.0-alpha05" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note as of Dec 13th the 1.0.0-beta01 release of the graphics-core library is now available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it in latest patch
transaction.setDataSpace(targetSurfaceControl, if (isWideGamut) P3_XRB else SRGB_XRB) | ||
transaction.setExtendedRangeBrightness(targetSurfaceControl, hdrSdrRatio, desiredRatio) | ||
transaction.commit() | ||
super.onDrawComplete(targetSurfaceControl, transaction, frameBuffer, syncFence) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, delegation to the base class method is not necessary.
Also the implementation of GLFrameBufferRenderer already calls transaction.commit on your behalf so explicitly calling commit here is not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏾 Perfect - Thanks for letting me know
# Conflicts: # samples/README.md # samples/graphics/ultrahdr/src/main/res/values/strings.xml
Description
This PR uses UltraHDR image, and processes them through a OpenGL pipeline using fragment & vertex shaders. This then displays the output frame on the SurfaceView and shows the developer how to control the brightness of the UltraHDR Image.
The included fragment shader is a tone-mapping shader. Big thanks for @johnreck for the graphics code here!
How Has This Been Tested?
Test Configuration #1 - Pixel 8 Pro API 34 Beta (Android 14)
Test Configuration #1 - Pixel 7 Pro API 34 Beta (Android 14 Beta)
Demo
Recording
Screen_recording_20231206_124542.mp4