Nick Fisher 436873a455 successfully creating D3D texture with D3D11_RESOURCE_MISC_SHARED_NTHANDLE;
successfully allocating with VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT

working copying vulkan texture

successfully passing D3D texture back to Flutter

chore: Dart/Windows sample project: remove unnnecessary InvalidateRect from update()

chore: Dart/Windows sample project: add generated bindings

successfully blitting from Vulkan swapchain to D3D texture

working Vulkan texture integration with Flutter

refactor to allow disposal of resources in destructors

handle destroyTexture correctly

correctly implement surface resizing/destruction

move Windows engine to Vulkan backend and flush after creating swapchain

add vulkan + vkshaders to Windows libs

update materials with Vulkan

move Vulkan implementation to thermion_Dart

remove extras folder

thermion_flutter plugin updates

update build hook to copy .lib file to output directory and use -vulkan lib zip file

thermion_flutter cleanup

reinstate stereoscopic on Windows

add dxgi and d3d11.lib to windows header pragma

update cli_windows sample project

copy filament/vulkan headers to output directory. This was originally added to facilitate linking on Windows (where thermion_flutter_plugin.cpp needs the Vulkan-related headers), but this doesn't actually solve the problem because there's no way that I've found to get the directory structure correct in the Dart native_assets build directory unless you explicitly address each inidivual file. The current approach is therefore to just keep a permanent copy of the headers in the thermion_filament directory (meaning these will need to be updated manually if the Filament version changes). However, I decided to keep the changes to build.dart because it doesn't have much negative impact and may be helpful in future.

disable stereoscopic on Windows and disable handle use after free checks

use filament headers for thermion_flutter

throw Exception for MSAA on Windows (note that passing msaa:true for setAntiAliasing doesn't actually set MSAA on other platforms, but at least it won't cause the engine to crash)

change header include path for Windows/Vulkan

change header include path for Windows/Vulkan

add filament/vulkan headers for flutter (Windows)

ensure destroyTexture platform methods accept an integer rather than a list

handle Android/Windows swapchain creation separately
2024-11-11 12:49:40 +08:00
2024-11-02 16:41:14 +11:00
2024-06-20 09:07:53 +02:00
2024-11-02 10:23:36 +08:00
2024-10-23 15:04:26 +08:00
2024-06-24 08:28:42 +02:00
2024-06-19 15:47:00 +02:00
2024-11-02 10:23:36 +08:00

Thermion Logo

Quickstart (Flutter)DocumentationShowcasePlaygroundDiscord

Cross-platform 3D toolkit for Dart and Flutter.

pub github discord contributors

Features

  • Supports iOS (arm64), MacOS (arm64/x64), Android (arm64), Windows (x64) (>= 10), Web/WASM
  • glTF, KTX, PNG & JPEG texture support
  • camera/entity manipulation with mouse (desktop) and gestures (mobile)
  • skinning + morph animations

Quickstart (Flutter)

From the command line:

flutter channel master
flutter upgrade
flutter config --enable-native-assets  

In your Flutter app:

_thermionViewer = await ThermionFlutterPlugin.createViewer();

// Geometry and models are represented as "entities". Here, we load a glTF
// file containing a plain cube.
// By default, all paths are treated as asset paths. To load from a file 
// instead, use file:// URIs.
var entity =
    await _thermionViewer!.loadGlb("assets/cube.glb", keepData: true);

// Thermion uses a right-handed coordinate system where +Y is up and -Z is
// "into" the screen.
// By default, the camera is located at (0,0,0) looking at (0,0,-1); this
// would place it directly inside the cube we just loaded.
//
// Let's move the camera to (0,0,10) to ensure the cube is visible in the
// viewport.
await _thermionViewer!.setCameraPosition(0, 0, 10);

// Without a light source, your scene will be totally black. Let's load a skybox
// (a cubemap image that is rendered behind everything else in the scene)
// and an image-based indirect light that has been precomputed from the same
// skybox.
await _thermionViewer!.loadSkybox("assets/default_env_skybox.ktx");
await _thermionViewer!.loadIbl("assets/default_env_ibl.ktx");

// Finally, you need to explicitly enable rendering. Setting rendering to
// false is designed to allow you to pause rendering to conserve battery life
await _thermionViewer!.setRendering(true);

and then in your widget tree:

 @override
  Widget build(BuildContext context) {
    return Stack(children: [
      if (_thermionViewer != null)
        Positioned.fill(
            child: ThermionWidget(
          viewer: _thermionViewer!,
        )),
    ]);
  }

Sponsors, Contributors & Acknowledgments

Thermion uses the Filament Physically Based Rendering engine under the hood.

Special thanks to odd-io for sponsoring work on supporting Windows, raycasting, testing and documentation.

Thank you to the following people:

  • @Hannnes1 for help migrating to native-assets
  • @jarrodcolburn for documentation contributions
  • @daverin for MacOS library contributions
  • @LukasPoque for CI/refactoring work
  • @alexmercerind for his work on integrating ANGLE textures on Flutter Windows
Description
No description provided
Readme Apache-2.0 458 MiB
Languages
C++ 48.3%
C 45.1%
Dart 5.8%
Objective-C 0.2%
CMake 0.2%
Other 0.2%