Android, iOS, macOS supported

This commit is contained in:
Nick Fisher
2023-10-03 00:34:29 +08:00
parent 0b9091fca5
commit bde15ab233
123 changed files with 479 additions and 538 deletions

View File

@@ -1,27 +1,34 @@
# polyvox_filament
Flutter plugin wrapping the Filament renderer https://github.com/google/filament.
Current Filament version: 112366e54524149e3a5cc601067280766efe06df
Filament is bundled with pre-compiled static libraries:
All:
- clone Filament repository
- copy filament/include to ios/include
- copy filament/libs/utils/include to ios/include
iOS/MacOS: v1.43.1
(iOS release build has a skybox bug so the debug versions are currently shipped on iOS)
Windows - v1.32.4
(Waiting for https://github.com/google/filament/issues/7078 to be resolved before upgrading, not sure exactly when the bug was introduced but it was somewhere between v1.34.2 and v1.40.0)
Linux - TODO, previously was v1.24.1 but this needs to be bumped up to parity with the other platforms (ideally v.1.43.1)
(even though headers are under the iOS directory these are used across all platforms).
Only arm64 libs are provided for iOS/MacOS, only x64 libs are provided for Windows/Linux, all provided for Android.
Android:
- IMPORTANT - current version only works on Flutter 3.15.0-15.2.pre
- build from Filament repository on Linux (build native, then build Android). Reminder that NDK >= 24 required.
- need to specifically move imageio/png/tinyexr
Building notes:
- we remove -fno-exceptions from CMakeLists.txt
Project structure:
- most shared code/headers under ios/src (because I still can't get podspec to build a target with symlinks or relative paths)
- building on MacOS, we currently just delete the macos/include and macos/src directories and copy from iOS (for same reason),
e.g.
`rm -r ../macos/include && cp -R ../ios/include ../macos && rm -r ../macos/src && cp -R ../ios/src ../macos && pushd macos && pod update && popd && flutter run -d macos`
- Android keeps a separate copy of ALL headers (because it's currently running a different version of Filament, earlier versions have some texture filtering issues)
-- can't symlink either?
--- IMPORTANT - current version only works on Flutter 3.15.0-15.2.pre / Filament v1.43.1
- Note also need to specifically build imageio/png/tinyexr
- if release build, then need to comment out -fno-exceptions
- copy out/android-release/filament/lib to android/src/main/jniLibs
iOS:
- filament-v1.25.0-ios.tgz
Linux:
Linux specific
(Fedora 34)
Building Filament:
@@ -59,4 +66,14 @@ and theme must have the following in `styles.xml`
Remember to set the background colour for your Scaffold to transparent!
Materials
- there is a simple material (unlit/opaque) used for background images. This is created by:
```
filament/out/release/filament/bin/matc -a opengl -a metal -o materials/image.filamat materials/image.mat
filament/out/release/filament/bin/resgen -c -p image -x ios/include/material/ materials/image.filamat
```