-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60738ed
commit b817250
Showing
2 changed files
with
25 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,52 @@ | ||
# Introduction | ||
|
||
As we know, the importance of mobile devices graphics is increasing for this digital world. There are various types of mobile devices that require presentation, interaction, visualization, and other related graphics is one of major mobile device markets. | ||
As we know, the importance of mobile devices graphics is increasing for this digital world. The mobile device market encompasses various requsts on graphic capabilities for presentation, interaction, visualization, and other related functions. | ||
We propose a new rendering pipeline to extend the USD capabilities to support Android platform with Vulkan backend. The new solution helps benefit Android users from the USD ecosystem. | ||
|
||
# Technical challenges: | ||
|
||
These are the limitations in USD and we have addressed them in our Android work. | ||
- USD does not support Android including build system, rendering pipeline, lib plugin, file loader system and so on | ||
- hgiVulkan backend does not support Android specific function and parameters | ||
- The Vulkan version in hgiVulkan is too high, resulting in fewer machines that can be adapted | ||
- HgiVulkan backend does not support Vulkan Android extension (e.g. VK_USE_PLATFORM_ANDROID_KHR, VK_KHR_ANDROID_SURFACE_EXTENSION_NAME), the Vulkan context cannot be initialized on Android. | ||
- From this prototype mentioned in the proposal, minimum supported Vulkan version in HgiVulkan is 1.2, resulting in fewer machines that can be adapted | ||
- Currently there is no Android demo app | ||
|
||
|
||
|
||
# Implementation | ||
|
||
## Development environment | ||
## Recommend Development environment | ||
- IDE: Android Studio Flamingo | 2022.2.1 Patch 2 | ||
- Development Kit: NDK 25.2.9519653 | ||
- Development Kit: The minimum supported NDK version is 22.0.7026061. In this prototype, we use 25.2.9519653 that is recommended. | ||
|
||
|
||
## Changes/Development: | ||
- Compiled all core USD components on Android | ||
- Add the Android specific Vulkan features to hgiVulkan | ||
- Create a way of USD plugin management to meet Android's security policy requirements | ||
- Build pass rendering pipeline OpenSubdiv support | ||
- Demangle function names properly for Android platform | ||
- Downgrade the Vulkan version to 1.0 in hgiVulkan for Android to adapt the Android devices | ||
- Create first Android Studio project to render final frame on Android with hgiVulkan backend | ||
- Compiled all core USD components on Android. Disabled projects that can't run on Android, including usdviewq and all projects in USD/pxr/usd/bin. | ||
|
||
- Created a way of USD plugin management to meet Android's security policy requirements. Originally, the USD plugin management mechanism loaded plugin libraries with the relative path by reading a JSON file. When we use NDK development on Android, we need to put the .so files in the jniLibs.srcDirs directory for the compiler to link them. After that, the .so files will be packaged into the APK file. If we put the JSON file in the jniLibs.srcDirs directory, it will not be packaged into the APK. To solve this problem, we put all non-so files in the Android app-specific location and specify this location through the environment variable 'PXRPLUGINPATHNAME'. After parsing the JSON file, USD is forced to specify the location of the .so files as jniLibs.srcDirs. | ||
|
||
- Demangle function names properly for Android platform. The real namespace of standard library on Android is '__ndk1' other than 'std', so the original implementation can't demangle the symbols properly. | ||
|
||
- Create first Android Studio project to render final frame on Android with HgiVulkan backend | ||
|
||
|
||
## HgiVulkan Android adaption | ||
The HgiVulkan module for Android depends on another work, and its proposal is https://github.com/PixarAnimationStudios/OpenUSD-proposals/pull/15. It elaborates how to support Vulkan 1.0 in HgiVulkan. The current HgiVulkan support Vulkan 1.2 or higher, but there are very few Android devices that support Vulkan 1.2. Therefore, degrade HgiVulkan to support Vulkan 1.0 that is supported by most of Android devices. Here we list the work to adapt HgiVulkan to Android. | ||
- Add the Android-specific Vulkan extensions to HgiVulkan to enable right initialization of Vulkan on Android. | ||
- VK_USE_PLATFORM_ANDROID_KHR: | ||
- VK_KHR_ANDROID_SURFACE_EXTENSION_NAME | ||
|
||
# Showcase | ||
- Devices: Galaxy Tab S8+ (model: SM-X800), | ||
- Devices: Galaxy Tab S8+ (model: SM-X800) | ||
- Android version: 13 | ||
|
||
![Screenshot](android-model.png) | ||
|
||
|
||
# Screenshot of build process | ||
![buildpass](buildPass.png) | ||
|
||
|
||
# Future Work | ||
- Validation on more Android devices | ||
- Improved stability on Android Devices | ||
- Improved performance | ||
- Improved performance |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.