move flutter_filament plugin to federated structure

This commit is contained in:
Nick Fisher
2024-05-15 22:25:46 +08:00
parent 66e5e38324
commit 6b50dc9d36
325 changed files with 32625 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
*.a filter=lfs diff=lfs merge=lfs -text
*.lib filter=lfs diff=lfs merge=lfs -text
*.dll filter=lfs diff=lfs merge=lfs -text
*.pdb filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.uberz filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.ktx filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
*.gltf filter=lfs diff=lfs merge=lfs -text
*.glb filter=lfs diff=lfs merge=lfs -text

View File

@@ -0,0 +1,2 @@
.vscode
.DS_Store

View File

@@ -0,0 +1 @@
TODO: Add your license here.

View File

@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

View File

@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures

View File

@@ -0,0 +1,61 @@
cmake_minimum_required(VERSION 3.10)
include_directories(../ios/src)
include_directories(../ios/include)
include_directories(../ios/include/filament)
include_directories(src/main/cpp)
link_directories(src/main/jniLibs/${ANDROID_ABI})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
add_library(flutter_filament_android SHARED
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/FlutterFilamentApi.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/FlutterFilamentFFIApi.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/FilamentAndroid.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/SceneManager.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/FilamentViewer.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/StreamBufferAdapter.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/TimeIt.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/camutils/Manipulator.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/camutils/Bookmark.cpp"
)
add_library(FILAMENT_SHADERS SHARED
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/include/material/image.c"
)
target_link_libraries(
flutter_filament_android
FILAMENT_SHADERS
-landroid
-llog
-lgltfio_core
-lfilament
-lbackend
-lgeometry
-lfilameshio
-lfilamat
-lfilabridge
-lcamutils
-lfilaflat
-ldracodec
-libl
-lktxreader
-limageio
-limage
-lutils
-ltinyexr
-lstb
-lbluevk
-lvkshaders
-luberzlib
-lsmol-v
-luberarchive
-lmeshoptimizer
-lgeometry
-lbasis_transcoder
-lGLESv3
-lEGL
-lpng
-lz
-lzstd
)

View File

@@ -0,0 +1,63 @@
group 'app.polyvox.filament'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 33
ndkVersion '25.2.9519653'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 22
ndk {
abiFilters 'arm64-v8a' // 'x86_64' 'armeabi-v7a'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
version "3.18.1"
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'net.java.dev.jna:jna:5.10.0@aar'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
}

View File

@@ -0,0 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true

View File

@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip

View File

@@ -0,0 +1 @@
rootProject.name = 'flutter_filament'

View File

@@ -0,0 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.polyvox.filament">
</manifest>

View File

@@ -0,0 +1,21 @@
#include <android/native_window_jni.h>
#include <android/native_activity.h>
extern "C" {
#include "FlutterFilamentFFIApi.h"
void* get_native_window_from_surface(
jobject surface,
JNIEnv* env
) {
void* window = ANativeWindow_fromSurface(env, surface);
return window;
}
// this does nothing, but we need it for JNA to return the correct pointer
FilamentRenderCallback make_render_callback_fn_pointer(FilamentRenderCallback callback) {
return callback;
}
}

View File

@@ -0,0 +1,48 @@
package app.polyvox.filament
import com.sun.jna.ptr.PointerByReference
import com.sun.jna.ptr.IntByReference
import android.view.Surface
import android.content.res.AssetManager
import com.sun.jna.*
open class ResourceBuffer: Structure(), Structure.ByValue {
@JvmField var data: Pointer = Pointer(0);
@JvmField var size: Int = 0;
@JvmField var id: Int = 0;
override fun getFieldOrder(): List<String> {
return listOf("data", "size", "id")
}
}
interface LoadFilamentResourceFromOwner : Callback {
fun loadResourceFromOwner(resourceName: String?, owner: Pointer?): ResourceBuffer
}
interface FreeFilamentResourceFromOwner : Callback {
fun freeResourceFromOwner(rb: ResourceBuffer, owner: Pointer?)
}
interface RenderCallback : Callback {
fun renderCallback(owner:Pointer?)
}
interface FilamentInterop : Library {
fun get_native_window_from_surface(surface:Object, env:JNIEnv) : Pointer?;
fun make_render_callback_fn_pointer(renderCallback:RenderCallback) : Pointer
fun make_resource_loader(loadResourceFromOwner: LoadFilamentResourceFromOwner, freeResource: FreeFilamentResourceFromOwner, owner:Pointer?) : Pointer;
fun create_filament_viewer_ffi(context:Pointer, platform:Pointer, loader:Pointer, rc:Pointer, rco:Pointer) : Pointer;
fun create_swap_chain_ffi(vieer:Pointer?, surface:Pointer?, width:Int, height:Int)
fun set_background_color_ffi(viewer: Pointer?, r: Float, g: Float, b: Float, a: Float)
fun update_viewport_and_camera_projection_ffi(viewer: Pointer?, width: Int, height: Int, scale_factor: Float)
fun render_ffi(viewer: Pointer?)
fun create_filament_viewer(context:Pointer?, platform:Pointer?, loader:Pointer?) : Pointer;
fun create_swap_chain(vieer:Pointer?, surface:Pointer?, width:Int, height:Int)
fun set_background_color(viewer: Pointer?, r: Float, g: Float, b: Float, a: Float)
fun update_viewport_and_camera_projection(viewer: Pointer?, width: Int, height: Int, scale_factor: Float)
fun render(viewer: Pointer?, u:Long, a:Pointer?, b:Pointer?, c:Pointer?)
}

View File

@@ -0,0 +1,226 @@
package app.polyvox.filament
import HotReloadPathHelper
import android.app.Activity
import android.content.res.AssetManager
import android.graphics.*
import android.os.Build
import android.util.Log
import android.view.Choreographer
import android.view.Surface
import androidx.annotation.NonNull
import androidx.annotation.RequiresApi
import androidx.lifecycle.Lifecycle
import com.sun.jna.*
import io.flutter.FlutterInjector
import io.flutter.embedding.engine.FlutterJNI
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
import io.flutter.embedding.engine.plugins.lifecycle.HiddenLifecycleReference
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.view.TextureRegistry.SurfaceTextureEntry
import java.io.File
import java.util.*
class LoadFilamentResourceFromOwnerImpl(plugin:FlutterFilamentPlugin) : LoadFilamentResourceFromOwner {
var plugin = plugin
override fun loadResourceFromOwner(path: String?, owner: Pointer?): ResourceBuffer {
return plugin.loadResourceFromOwner(path, owner)
}
}
class FreeFilamentResourceFromOwnerImpl(plugin:FlutterFilamentPlugin) : FreeFilamentResourceFromOwner {
var plugin = plugin
override fun freeResourceFromOwner(rb: ResourceBuffer, owner: Pointer?) {
plugin.freeResourceFromOwner(rb, owner)
}
}
class RenderCallbackImpl(plugin:FlutterFilamentPlugin) : RenderCallback {
var plugin = plugin
override fun renderCallback(owner:Pointer?) {
plugin.renderCallback();
if(!plugin._surface!!.isValid) {
Log.e("ERR", "ERR", null)
}
}
}
/** FlutterFilamentPlugin */
class FlutterFilamentPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, LoadFilamentResourceFromOwner, FreeFilamentResourceFromOwner {
companion object {
const val CHANNEL_NAME = "app.polyvox.filament/event"
const val TAG = "FilamentPlugin"
}
private lateinit var channel : MethodChannel
private lateinit var flutterPluginBinding : FlutterPlugin.FlutterPluginBinding
private var lifecycle: Lifecycle? = null
private lateinit var _lib : FilamentInterop
var _surfaceTexture: SurfaceTexture? = null
private var _surfaceTextureEntry: SurfaceTextureEntry? = null
var _surface: Surface? = null
private lateinit var activity:Activity
private var loadResourceWrapper:LoadFilamentResourceFromOwnerImpl = LoadFilamentResourceFromOwnerImpl(this)
private var freeResourceWrapper:FreeFilamentResourceFromOwnerImpl = FreeFilamentResourceFromOwnerImpl(this)
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
this.flutterPluginBinding = flutterPluginBinding
channel = MethodChannel(flutterPluginBinding.binaryMessenger, CHANNEL_NAME)
channel.setMethodCallHandler(this)
_lib = Native.loadLibrary("flutter_filament_android", FilamentInterop::class.java, Collections.singletonMap(Library.OPTION_ALLOW_OBJECTS, true))
}
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
lifecycle = (binding.lifecycle as? HiddenLifecycleReference)?.lifecycle
activity = binding.activity
activity.window.setFormat(PixelFormat.RGBA_8888)
}
val _resources:MutableMap<ResourceBuffer,Memory> = mutableMapOf();
var _lastId = 1
override fun loadResourceFromOwner(path: String?, owner: Pointer?): ResourceBuffer {
Log.i("flutter_filament", "Loading resource from path $path")
var data:ByteArray? = null
if(path!!.startsWith("file://")) {
data = File(path!!.substring(6)).readBytes()
} else {
var assetPath = path
if(assetPath.startsWith("asset://")) {
assetPath = assetPath!!.substring(8)
}
val loader = FlutterInjector.instance().flutterLoader()
val key = loader.getLookupKeyForAsset(assetPath)
val hotReloadPath = HotReloadPathHelper.getAssetPath(key, activity.getPackageName())
if (hotReloadPath != null) {
data = File(hotReloadPath).readBytes()
} else {
Log.i("flutter_filament", "Loading resource from main asset bundle at ${assetPath}")
val assetManager: AssetManager = activity.assets
try {
data = assetManager.open(key).readBytes()
Log.i("flutter_filament", "Loaded ${data.size} bytes")
} catch (e:Exception) {
Log.e("flutter_filament", "Failed to open asset at ${assetPath}", null)
}
}
}
val rb = ResourceBuffer();
try {
if (data != null) {
val dataPtr = Memory(data.size.toLong())
dataPtr.write(0, data, 0, data.size)
rb.data = dataPtr
rb.size = data.size
rb.id = _lastId
_resources[rb] = dataPtr;
_lastId++
} else {
rb.id = 0
rb.size = 0
rb.data = Pointer(0)
}
} catch(e:Exception) {
Log.e("flutter_filament", "Error setting resource buffer : $e", null);
}
rb.write();
return rb;
}
override fun freeResourceFromOwner(rb: ResourceBuffer, owner: Pointer?) {
_resources.remove(rb)
}
fun renderCallback() {
// noop, log or check surface.valid() is you want
}
@RequiresApi(Build.VERSION_CODES.M)
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
Log.e("flutter_filament", call.method, null)
when (call.method) {
"createTexture" -> {
if(_surfaceTextureEntry != null) {
result.error("TEXTURE_EXISTS", "Texture already exist. Make sure you call destroyTexture first", null)
return
}
val args = call.arguments as List<*>
val width = args[0] as Double
val height = args[1] as Double
if(width <1 || height < 1) {
result.error("DIMENSION_MISMATCH","Both dimensions must be greater than zero (you provided $width x $height)", null);
return;
}
Log.i("flutter_filament", "Creating Surface Texture of size ${width}x${height}");
_surfaceTextureEntry = flutterPluginBinding.textureRegistry.createSurfaceTexture()
_surfaceTexture = _surfaceTextureEntry!!.surfaceTexture();
_surfaceTexture!!.setDefaultBufferSize(width.toInt(), height.toInt())
_surface = Surface(_surfaceTexture)
if(!_surface!!.isValid) {
Log.e("ERR", "ERR", null)
}
val nativeWindow = _lib.get_native_window_from_surface(_surface!! as Object, JNIEnv.CURRENT)
val resultList = listOf(_surfaceTextureEntry!!.id(), Pointer.nativeValue(nativeWindow), null, null )
result.success(resultList)
}
"getResourceLoaderWrapper" -> {
val resourceLoader = _lib.make_resource_loader(loadResourceWrapper, freeResourceWrapper, Pointer(0))
result.success(Pointer.nativeValue(resourceLoader))
}
"getRenderCallback" -> {
val renderCallbackFnPointer = _lib.make_render_callback_fn_pointer(RenderCallbackImpl(this))
result.success(listOf(Pointer.nativeValue(renderCallbackFnPointer), 0))
}
"destroyTexture" -> {
_surface!!.release();
_surfaceTextureEntry!!.release();
_surface = null
_surfaceTextureEntry = null
result.success(true)
}
else -> {
result.notImplemented()
}
}
}
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
channel.setMethodCallHandler(null)
}
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
onAttachedToActivity(binding)
}
override fun onDetachedFromActivityForConfigChanges() {
onDetachedFromActivity()
}
override fun onDetachedFromActivity() {
lifecycle = null
}
}

View File

@@ -0,0 +1,28 @@
import java.io.*
import java.nio.file.FileSystems
import java.nio.file.Files
import java.nio.file.Path
import kotlin.io.path.absolutePathString
import kotlin.io.path.listDirectoryEntries
import android.util.Log
class HotReloadPathHelper {
companion object {
fun getAssetPath(path: String, packageName: String): String? {
val packagePath = "/data/user/0/${packageName}/code_cache/"
Log.v("flutter_filament", "Looking for hot reloaded asset ${path} under package path ${packagePath}")
val files = File(packagePath).walkBottomUp().filter {
it.path.endsWith(path)
}.sortedBy {
it.lastModified()
}.toList()
if(files.size > 0) {
Log.v("flutter_filament", "Using hot reloaded asset at ${files.last().path}")
return files.last().path;
}
Log.v("flutter_filament", "No hot reloaded asset found.")
return null;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -0,0 +1,313 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="698.05615mm"
height="271.6131mm"
viewBox="0 0 698.05615 271.6131"
version="1.1"
id="svg5"
inkscape:version="1.2.2 (b0a84865, 2022-12-01)"
sodipodi:docname="drawing.svg"
inkscape:export-filename="drawing.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="1.0406414"
inkscape:cx="441.55462"
inkscape:cy="759.14723"
inkscape:window-width="1390"
inkscape:window-height="950"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="0"
inkscape:current-layer="layer1" />
<defs
id="defs2">
<marker
style="overflow:visible"
id="TriangleStart"
refX="0"
refY="0"
orient="auto-start-reverse"
inkscape:stockid="TriangleStart"
markerWidth="5.3244081"
markerHeight="6.155385"
viewBox="0 0 5.3244081 6.1553851"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.5)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 5.77,0 -2.88,5 V -5 Z"
id="path135" />
</marker>
<marker
style="overflow:visible"
id="TriangleStart-5"
refX="0"
refY="0"
orient="auto-start-reverse"
inkscape:stockid="TriangleStart"
markerWidth="5.3244081"
markerHeight="6.155385"
viewBox="0 0 5.3244081 6.1553851"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.5)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 5.77,0 -2.88,5 V -5 Z"
id="path135-8" />
</marker>
<marker
style="overflow:visible"
id="TriangleStart-7"
refX="0"
refY="0"
orient="auto-start-reverse"
inkscape:stockid="TriangleStart"
markerWidth="5.3244081"
markerHeight="6.155385"
viewBox="0 0 5.3244081 6.1553851"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.5)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 5.77,0 -2.88,5 V -5 Z"
id="path135-7" />
</marker>
<marker
style="overflow:visible"
id="TriangleStart-7-1"
refX="0"
refY="0"
orient="auto-start-reverse"
inkscape:stockid="TriangleStart"
markerWidth="5.3244081"
markerHeight="6.155385"
viewBox="0 0 5.3244081 6.1553851"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.5)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 5.77,0 -2.88,5 V -5 Z"
id="path135-7-1" />
</marker>
<marker
style="overflow:visible"
id="TriangleStart-50"
refX="0"
refY="0"
orient="auto-start-reverse"
inkscape:stockid="TriangleStart"
markerWidth="5.3244081"
markerHeight="6.155385"
viewBox="0 0 5.3244081 6.1553851"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.5)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 5.77,0 -2.88,5 V -5 Z"
id="path135-0" />
</marker>
<marker
style="overflow:visible"
id="TriangleStart-5-1"
refX="0"
refY="0"
orient="auto-start-reverse"
inkscape:stockid="TriangleStart"
markerWidth="5.3244081"
markerHeight="6.155385"
viewBox="0 0 5.3244081 6.1553851"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.5)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 5.77,0 -2.88,5 V -5 Z"
id="path135-8-3" />
</marker>
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-3.5245818,9.2399567)">
<rect
style="fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:0.927375;stroke-miterlimit:4.7;stroke-dasharray:none"
id="rect234-1"
width="379.63364"
height="129.73656"
x="3.9882693"
y="-5.8997526" />
<rect
style="fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:1.09465;stroke-miterlimit:4.7;stroke-dasharray:none"
id="rect234-1-3"
width="288.13705"
height="238.15767"
x="412.89633"
y="-8.6926317" />
<rect
style="fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:0.586207;stroke-miterlimit:4.7;stroke-dasharray:none"
id="rect234-1-3-0"
width="151.29199"
height="130.07773"
x="5.1431384"
y="132.0023" />
<text
xml:space="preserve"
style="font-size:12.7px;font-family:'HarmonyOS Sans SC';-inkscape-font-specification:'HarmonyOS Sans SC';text-align:center;letter-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:1.32292;stroke-miterlimit:4.7"
x="92.048431"
y="56.811131"
id="text398"><tspan
sodipodi:role="line"
id="tspan396"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.32292"
x="92.048431"
y="56.811131">FilamentController (Dart)</tspan></text>
<text
xml:space="preserve"
style="font-size:12.7px;font-family:'HarmonyOS Sans SC';-inkscape-font-specification:'HarmonyOS Sans SC';text-align:center;letter-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:1.32292;stroke-miterlimit:4.7"
x="304.37106"
y="57.530262"
id="text398-4"><tspan
sodipodi:role="line"
id="tspan396-8"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.32292"
x="304.37106"
y="57.530262">FlutterFilamentFFI</tspan></text>
<text
xml:space="preserve"
style="font-size:12.7px;font-family:'HarmonyOS Sans SC';-inkscape-font-specification:'HarmonyOS Sans SC';text-align:center;letter-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:1.32292;stroke-miterlimit:4.7"
x="578.62885"
y="60.701408"
id="text398-4-7"><tspan
sodipodi:role="line"
id="tspan396-8-1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.32292"
x="578.62885"
y="60.701408">FilamentViewer / Filament Engine (etc)</tspan></text>
<text
xml:space="preserve"
style="font-size:12.7px;font-family:'HarmonyOS Sans SC';-inkscape-font-specification:'HarmonyOS Sans SC';text-align:center;letter-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:1.32292;stroke-miterlimit:4.7"
x="472.51691"
y="10.943201"
id="text398-4-1"><tspan
sodipodi:role="line"
id="tspan396-8-9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.32292"
x="472.51691"
y="10.943201">Render thread</tspan></text>
<text
xml:space="preserve"
style="font-size:12.7px;font-family:'HarmonyOS Sans SC';-inkscape-font-specification:'HarmonyOS Sans SC';text-align:center;letter-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:1.32292;stroke-miterlimit:4.7"
x="69.463997"
y="14.792676"
id="text398-9"><tspan
sodipodi:role="line"
id="tspan396-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.32292"
x="69.463997"
y="14.792676">Main Flutter Thread</tspan></text>
<text
xml:space="preserve"
style="font-size:12.7px;font-family:'HarmonyOS Sans SC';-inkscape-font-specification:'HarmonyOS Sans SC';text-align:center;letter-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:1.32292;stroke-miterlimit:4.7"
x="78.957222"
y="191.72818"
id="text398-1"><tspan
sodipodi:role="line"
id="tspan396-7"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.32292"
x="78.957222"
y="191.72818">Platform Channel</tspan></text>
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.39242;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#TriangleStart)"
d="m 168.09598,47.800956 77.0034,-0.600221"
id="path1399"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0" />
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.39242;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#TriangleStart-50)"
d="m 245.89691,60.584035 -77.0034,-0.600221"
id="path1399-8"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0" />
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.53928;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#TriangleStart-7)"
d="M 48.091478,64.785894 47.803757,161.23719"
id="path1399-3"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0" />
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.53928;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#TriangleStart-7-1)"
d="M 107.57319,166.38716 107.28547,69.935859"
id="path1399-3-8"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0" />
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.39242;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#TriangleStart-5)"
d="m 370.3702,53.077344 77.0034,-0.600221"
id="path1399-6"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0" />
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.39242;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#TriangleStart-5-1)"
d="m 448.28011,64.65204 -77.0034,-0.600221"
id="path1399-6-4"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.35px;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.32292;stroke-miterlimit:4.7;stroke-dasharray:none"
x="83.648346"
y="207.46822"
id="text2612"><tspan
sodipodi:role="line"
id="tspan2610"
style="font-size:6.35px;stroke-width:1.32292"
x="83.648346"
y="207.46822">Sets up OpenGL/Metal/etc rendering context, </tspan><tspan
sodipodi:role="line"
style="font-size:6.35px;stroke-width:1.32292"
x="83.648346"
y="215.40572"
dx="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25425026"
id="tspan2614">render target textures/window, etc</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.35px;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.32292;stroke-miterlimit:4.7;stroke-dasharray:none"
x="79.772552"
y="225.02937"
id="text2612-4"><tspan
sodipodi:role="line"
style="font-size:6.35px;stroke-width:1.32292"
x="79.772552"
y="225.02937"
id="tspan2614-7">Asset loading</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,4 @@
{
"flutterSdkVersion": "3.16.0-0.2.pre",
"flavors": {}
}

View File

@@ -0,0 +1,30 @@
assets/lit_opaque_43.uberz filter=lfs diff=lfs merge=lfs -text
assets/BusterDrone filter=lfs diff=lfs merge=lfs -text
assets/FlightHelmet filter=lfs diff=lfs merge=lfs -text
assets/lit_opaque_32.uberz filter=lfs diff=lfs merge=lfs -text
windows/lib/**/*.* filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/12_Settonemappingtolinear.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/3_loadIBL.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/6_zoomin.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/13_Movecameratoasset.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/14_movecamerato.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/7_rotate.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/9_transformtounitcube.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/0_fresh.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/10_setshapespositionto.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/2_loadskybox.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/4_Renderingfalse.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/8_pan.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/11_Disablefrustumculling.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/15_setcameratofirstcamerainshapesGLB.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/1_createviewerdefaultubershader.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/5_loadshapesGLB.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/16_resize.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/3_loadskybox.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/4_loadIBL.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/19_resize.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/17_resize.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/2_Renderingfalse.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/18_resize.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/diffs filter=lfs diff=lfs merge=lfs -text

View File

@@ -0,0 +1,51 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
/android/.cxx/**/*
# fvm
.fvm/flutter_sdk

View File

@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: "12d54de962782853206992fedce29723fcb4a95b"
channel: "master"
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 12d54de962782853206992fedce29723fcb4a95b
base_revision: 12d54de962782853206992fedce29723fcb4a95b
- platform: macos
create_revision: 12d54de962782853206992fedce29723fcb4a95b
base_revision: 12d54de962782853206992fedce29723fcb4a95b
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'

View File

@@ -0,0 +1,21 @@
# flutter_filament_example
Demonstrates how to use the flutter_filament plugin.
## Linux
export PKG_CONFIG_PATH=/usr/lib/pkgconfig/:/usr/lib64/pkgconfig/
export CPLUS_INCLUDE_PATH=/usr/include/gtk-3.0/:/usr/include/pango-1.0/:/usr/include/harfbuzz:/usr/include/cairo/:/usr/include/gdk-pixbuf-2.0/:/usr/include/atk-1.0/
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

View File

@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

View File

@@ -0,0 +1,15 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
.cxx/
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks

View File

@@ -0,0 +1,81 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 34
ndkVersion "25.2.9519653"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "app.polyvox.flutter_filament_example"
minSdkVersion 22
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
ndk {
abiFilters 'arm64-v8a' // 'x86_64' 'armeabi-v7a'
}
}
buildTypes {
release {
signingConfig signingConfigs.debug
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.core:core:1.7.0"
implementation 'net.java.dev.jna:jna:5.10.0@aar'
}

View File

@@ -0,0 +1,9 @@
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn java.awt.*
-keep class com.sun.jna.* { *; }
-keepclassmembers class * extends com.sun.jna.* { public *; }

View File

@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.polyvox.flutter_filament_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@@ -0,0 +1,46 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.polyvox.flutter_filament_example">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:name="${applicationName}"
android:label="flutter_filament_example"
android:icon="@mipmap/ic_launcher"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

View File

@@ -0,0 +1,10 @@
package app.polyvox.flutter_filament_example
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.TransparencyMode
class MainActivity: FlutterActivity() {
override fun getTransparencyMode(): TransparencyMode {
return TransparencyMode.transparent
}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
</resources>

View File

@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.polyvox.flutter_filament_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@@ -0,0 +1,30 @@
buildscript {
ext.kotlin_version = '1.6.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

View File

@@ -0,0 +1,9 @@
org.gradle.jvmargs=-Xmx1536M \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
android.useAndroidX=true
android.enableJetifier=true

View File

@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip

View File

@@ -0,0 +1,15 @@
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 KiB

View File

@@ -0,0 +1,755 @@
{
"accessors": [
{
"componentType": 5123,
"count": 24408,
"type": "SCALAR"
},
{
"componentType": 5126,
"count": 8468,
"type": "VEC2"
},
{
"componentType": 5126,
"count": 8468,
"type": "VEC3"
},
{
"componentType": 5126,
"count": 8468,
"type": "VEC4"
},
{
"componentType": 5126,
"count": 8468,
"type": "VEC3",
"max": [
0.131662,
0.137638986,
0.10078799
],
"min": [
-0.131333,
-0.028128,
-0.137763992
]
},
{
"componentType": 5123,
"count": 65688,
"type": "SCALAR"
},
{
"componentType": 5126,
"count": 12552,
"type": "VEC2"
},
{
"componentType": 5126,
"count": 12552,
"type": "VEC3"
},
{
"componentType": 5126,
"count": 12552,
"type": "VEC4"
},
{
"componentType": 5126,
"count": 12552,
"type": "VEC3",
"max": [
0.11722149,
0.196387976,
0.132422984
],
"min": [
-0.11722149,
-0.196387976,
-0.132422984
]
},
{
"componentType": 5123,
"count": 2208,
"type": "SCALAR"
},
{
"componentType": 5126,
"count": 436,
"type": "VEC2"
},
{
"componentType": 5126,
"count": 436,
"type": "VEC3"
},
{
"componentType": 5126,
"count": 436,
"type": "VEC4"
},
{
"componentType": 5126,
"count": 436,
"type": "VEC3",
"max": [
0.09527509,
0.114654,
-0.08429489
],
"min": [
-0.0952748954,
0.0551489964,
-0.14295499
]
},
{
"componentType": 5123,
"count": 60288,
"type": "SCALAR"
},
{
"componentType": 5126,
"count": 17186,
"type": "VEC2"
},
{
"componentType": 5126,
"count": 17186,
"type": "VEC3"
},
{
"componentType": 5126,
"count": 17186,
"type": "VEC4"
},
{
"componentType": 5126,
"count": 17186,
"type": "VEC3",
"max": [
0.1572095,
0.2716865,
0.162181988
],
"min": [
-0.1572095,
-0.2716865,
-0.162181988
]
},
{
"componentType": 5123,
"count": 131574,
"type": "SCALAR"
},
{
"componentType": 5126,
"count": 24148,
"type": "VEC2"
},
{
"componentType": 5126,
"count": 24148,
"type": "VEC3"
},
{
"componentType": 5126,
"count": 24148,
"type": "VEC4"
},
{
"componentType": 5126,
"count": 24148,
"type": "VEC3",
"max": [
0.1504075,
0.328366965,
0.173673
],
"min": [
-0.1504075,
-0.328366965,
-0.173673
]
}
],
"asset": {
"generator": "glTF Tools for Unity",
"version": "2.0"
},
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 59806
},
{
"buffer": 0,
"byteOffset": 59808,
"byteLength": 99674
},
{
"buffer": 0,
"byteOffset": 159484,
"byteLength": 4875
},
{
"buffer": 0,
"byteOffset": 164360,
"byteLength": 133545
},
{
"buffer": 0,
"byteOffset": 297908,
"byteLength": 203914
}
],
"buffers": [
{
"name": "FlightHelmet",
"byteLength": 501824,
"uri": "FlightHelmet.bin"
}
],
"images": [
{
"name": "FlightHelmet_baseColor",
"uri": "FlightHelmet_baseColor.png"
},
{
"name": "FlightHelmet_occlusionRoughnessMetallic",
"uri": "FlightHelmet_occlusionRoughnessMetallic.png"
},
{
"name": "FlightHelmet_normal",
"uri": "FlightHelmet_normal.png"
},
{
"name": "FlightHelmet_baseColor1",
"uri": "FlightHelmet_baseColor1.png"
},
{
"name": "FlightHelmet_occlusionRoughnessMetallic1",
"uri": "FlightHelmet_occlusionRoughnessMetallic1.png"
},
{
"name": "FlightHelmet_normal1",
"uri": "FlightHelmet_normal1.png"
},
{
"name": "FlightHelmet_baseColor2",
"uri": "FlightHelmet_baseColor2.png"
},
{
"name": "FlightHelmet_occlusionRoughnessMetallic2",
"uri": "FlightHelmet_occlusionRoughnessMetallic2.png"
},
{
"name": "FlightHelmet_normal2",
"uri": "FlightHelmet_normal2.png"
},
{
"name": "FlightHelmet_baseColor3",
"uri": "FlightHelmet_baseColor3.png"
},
{
"name": "FlightHelmet_occlusionRoughnessMetallic3",
"uri": "FlightHelmet_occlusionRoughnessMetallic3.png"
},
{
"name": "FlightHelmet_normal3",
"uri": "FlightHelmet_normal3.png"
},
{
"name": "FlightHelmet_baseColor4",
"uri": "FlightHelmet_baseColor4.png"
},
{
"name": "FlightHelmet_occlusionRoughnessMetallic4",
"uri": "FlightHelmet_occlusionRoughnessMetallic4.png"
},
{
"name": "FlightHelmet_normal4",
"uri": "FlightHelmet_normal4.png"
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"TEXCOORD_0": 1,
"NORMAL": 2,
"TANGENT": 3,
"POSITION": 4
},
"indices": 0,
"material": 0,
"mode": 4,
"extensions": {
"KHR_draco_mesh_compression": {
"bufferView": 0,
"attributes": {
"TEXCOORD_0": 0,
"NORMAL": 1,
"TANGENT": 2,
"POSITION": 3
}
}
}
}
],
"name": "GlassPlastic_low"
},
{
"primitives": [
{
"attributes": {
"TEXCOORD_0": 6,
"NORMAL": 7,
"TANGENT": 8,
"POSITION": 9
},
"indices": 5,
"material": 1,
"mode": 4,
"extensions": {
"KHR_draco_mesh_compression": {
"bufferView": 1,
"attributes": {
"TEXCOORD_0": 0,
"NORMAL": 1,
"TANGENT": 2,
"POSITION": 3
}
}
}
}
],
"name": "LeatherParts_low"
},
{
"primitives": [
{
"attributes": {
"TEXCOORD_0": 11,
"NORMAL": 12,
"TANGENT": 13,
"POSITION": 14
},
"indices": 10,
"material": 2,
"mode": 4,
"extensions": {
"KHR_draco_mesh_compression": {
"bufferView": 2,
"attributes": {
"TEXCOORD_0": 0,
"NORMAL": 1,
"TANGENT": 2,
"POSITION": 3
}
}
}
}
],
"name": "Lenses_low"
},
{
"primitives": [
{
"attributes": {
"TEXCOORD_0": 16,
"NORMAL": 17,
"TANGENT": 18,
"POSITION": 19
},
"indices": 15,
"material": 3,
"mode": 4,
"extensions": {
"KHR_draco_mesh_compression": {
"bufferView": 3,
"attributes": {
"TEXCOORD_0": 0,
"NORMAL": 1,
"TANGENT": 2,
"POSITION": 3
}
}
}
}
],
"name": "MetalParts_low"
},
{
"primitives": [
{
"attributes": {
"TEXCOORD_0": 21,
"NORMAL": 22,
"TANGENT": 23,
"POSITION": 24
},
"indices": 20,
"material": 4,
"mode": 4,
"extensions": {
"KHR_draco_mesh_compression": {
"bufferView": 4,
"attributes": {
"TEXCOORD_0": 0,
"NORMAL": 1,
"TANGENT": 2,
"POSITION": 3
}
}
}
}
],
"name": "RubberWood_low"
}
],
"materials": [
{
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 0,
"texCoord": 0
},
"metallicRoughnessTexture": {
"index": 1,
"texCoord": 0
},
"baseColorFactor": [
1,
1,
1,
1
],
"metallicFactor": 1,
"roughnessFactor": 1
},
"normalTexture": {
"index": 2,
"texCoord": 0
},
"occlusionTexture": {
"index": 1,
"texCoord": 0
},
"name": "GlassPlasticMat",
"emissiveFactor": [
0,
0,
0
],
"alphaMode": "OPAQUE",
"doubleSided": false
},
{
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 3,
"texCoord": 0
},
"metallicRoughnessTexture": {
"index": 4,
"texCoord": 0
},
"baseColorFactor": [
1,
1,
1,
1
],
"metallicFactor": 1,
"roughnessFactor": 1
},
"normalTexture": {
"index": 5,
"texCoord": 0
},
"occlusionTexture": {
"index": 4,
"texCoord": 0
},
"name": "LeatherPartsMat",
"emissiveFactor": [
0,
0,
0
],
"alphaMode": "OPAQUE",
"doubleSided": false
},
{
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 6,
"texCoord": 0
},
"metallicRoughnessTexture": {
"index": 7,
"texCoord": 0
},
"baseColorFactor": [
1,
1,
1,
1
],
"metallicFactor": 1,
"roughnessFactor": 1
},
"normalTexture": {
"index": 8,
"texCoord": 0
},
"occlusionTexture": {
"index": 7,
"texCoord": 0
},
"alphaMode": "BLEND",
"name": "LensesMat",
"emissiveFactor": [
0,
0,
0
],
"doubleSided": false
},
{
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 9,
"texCoord": 0
},
"metallicRoughnessTexture": {
"index": 10,
"texCoord": 0
},
"baseColorFactor": [
1,
1,
1,
1
],
"metallicFactor": 1,
"roughnessFactor": 1
},
"normalTexture": {
"index": 11,
"texCoord": 0
},
"occlusionTexture": {
"index": 10,
"texCoord": 0
},
"name": "MetalPartsMat",
"emissiveFactor": [
0,
0,
0
],
"alphaMode": "OPAQUE",
"doubleSided": false
},
{
"doubleSided": true,
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 12,
"texCoord": 0
},
"metallicRoughnessTexture": {
"index": 13,
"texCoord": 0
},
"baseColorFactor": [
1,
1,
1,
1
],
"metallicFactor": 1,
"roughnessFactor": 1
},
"normalTexture": {
"index": 14,
"texCoord": 0
},
"occlusionTexture": {
"index": 13,
"texCoord": 0
},
"name": "RubberWoodMat",
"emissiveFactor": [
0,
0,
0
],
"alphaMode": "OPAQUE"
}
],
"nodes": [
{
"mesh": 0,
"name": "GlassPlastic_low"
},
{
"mesh": 1,
"translation": [
0.000434499962,
0.032592997,
0.011676996
],
"name": "LeatherParts_low",
"rotation": [
0,
0,
0,
1
],
"scale": [
1,
1,
1
]
},
{
"mesh": 2,
"name": "Lenses_low"
},
{
"mesh": 3,
"translation": [
0.0331545,
-0.1488645,
-0.0242879968
],
"name": "MetalParts_low",
"rotation": [
0,
0,
0,
1
],
"scale": [
1,
1,
1
]
},
{
"mesh": 4,
"translation": [
-0.00190849893,
-0.111985,
-0.013313001
],
"name": "RubberWood_low",
"rotation": [
0,
0,
0,
1
],
"scale": [
1,
1,
1
]
},
{
"children": [
0,
1,
2,
3,
4
],
"rotation": [
0,
1,
0,
0
],
"name": "FlightHelmet",
"translation": [
0,
0,
0
],
"scale": [
1,
1,
1
]
}
],
"scene": 0,
"scenes": [
{
"nodes": [
5
]
}
],
"textures": [
{
"source": 0
},
{
"source": 1
},
{
"source": 2
},
{
"source": 3
},
{
"source": 4
},
{
"source": 5
},
{
"source": 6
},
{
"source": 7
},
{
"source": 8
},
{
"source": 9
},
{
"source": 10
},
{
"source": 11
},
{
"source": 12
},
{
"source": 13
},
{
"source": 14
}
],
"extensionsRequired": [
"KHR_draco_mesh_compression"
],
"extensionsUsed": [
"KHR_draco_mesh_compression"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

View File

@@ -0,0 +1,16 @@
# Flight Helmet
## Screenshot
![screenshot](screenshot/screenshot.jpg)
## License Information
Donated by Microsoft for glTF testing
[![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/)
To the extent possible under law, Microsoft has waived all copyright and related or neighboring rights to this asset.
Draco compression was done via Cesium tools on 27-03-2020 as follows.
gltf-pipeline -i FlightHelmet.gltf -o FlightHelmet.gltf -d -s --keep-unused-elements

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -0,0 +1,14 @@
material {
name : SolidColor,
shadingModel : unlit,
culling : none,
featureLevel : 1,
vertexDomain: object
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
material.baseColor = vec4(0.1f, 0.5f, 0.9f, 1.0f);
}
}

View File

@@ -0,0 +1,9 @@
#!/bin/bash
device=$1
if [ -z "$device" ]; then
echo "Usage: $0 <device_id>"
exit 1;
fi
rm -f integration_test/goldens/{ios,macos,windows,android}/diffs/*.png
flutter drive --driver=test_driver/integration_test.dart -d $1 --target=integration_test/plugin_integration_test.dart

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Some files were not shown because too many files have changed in this diff Show More