Commit Graph

196 Commits

Author SHA1 Message Date
Nick Fisher 5fe985d2c7 add create/set camera render thread functions 2025-01-07 08:25:48 +08:00
Nick Fisher 80ca4b97a9 add create/set camera render thread functions 2025-01-07 08:25:48 +08:00
Nick Fisher fb650dbd52 allow null parent to setParent 2025-01-07 08:25:48 +08:00
Nick Fisher c34c7d5545 change grid priority 2025-01-07 08:25:48 +08:00
Nick Fisher fe37d45e1a return null entity for grid overlay 2025-01-07 08:25:48 +08:00
Nick Fisher bf3d4f7c0e add dithering to view 2025-01-07 08:25:48 +08:00
Nick Fisher 69643e26f6 whitespace 2025-01-07 08:25:48 +08:00
Nick Fisher 44b502a1e4 add dithering to view 2025-01-07 08:25:48 +08:00
Nick Fisher d72ed58436 in createGeometry, all geometry entities to scene 2025-01-07 08:25:48 +08:00
Nick Fisher d53a8b20b8 move Geometry asset builder from header to own implementation 2025-01-07 08:25:48 +08:00
Nick Fisher aa7350c419 gizmo & picking improvements 2025-01-07 08:25:48 +08:00
Nick Fisher c2077cb6b1 fix: store reference to material instances in ThermionViewer so they can be cleaned up on dispose 2025-01-07 08:25:48 +08:00
Nick Fisher ed444b0615 feature!:
This is a breaking change needed to fully implement instancing and stencil highlighting.

Previously, users would work directly with entities (on the Dart side, ThermionEntity), e.g.

final entity = await viewer.loadGlb("some.glb");

However, Filament "entities" are a lower-level abstraction.

Loading a glTF file, for example, inserts multiple entities into the scene.

For example, each mesh, light, and camera within a glTF asset will be assigned an entity. A top-level (non-renderable) entity will also be created for the glTF asset, which can be used to transform the entire hierarchy.

"Asset" is a better representation for loading/inserting objects into the scene; think of this as a bundle of entities.

Unless you need to work directly with transforms, instancing, materials and renderables, you can work directly with ThermionAsset.
2024-11-27 15:02:37 +11:00
Nick Fisher 468cada6c6 update bindings 2024-11-21 12:31:58 +08:00
Nick Fisher e60ab51b79 fix: remove MaterialInstance from SceneManager storage when destroyed 2024-11-21 12:31:36 +08:00
Nick Fisher cabb62043d feat: re-add uvScale, vertexScale to unlit material 2024-11-21 12:30:51 +08:00
Nick Fisher b7bc46b94a feat: re-add uvScale, vertexScale to unlit material 2024-11-21 12:30:20 +08:00
Nick Fisher bc8edb7eb4 fix: remove MaterialInstance from SceneManager storage when destroyed 2024-11-21 12:29:54 +08:00
Nick Fisher 5deb2ad7cf chore: factor out SceneManager_ methods 2024-11-21 11:16:54 +08:00
Nick Fisher 26eba7ae09 fix!: update Makefile & rebuild materials for Vulkan 2024-11-21 10:07:08 +08:00
Nick Fisher 0b9f3160d9 feat: add MaterialInstance.setDepthFunc 2024-11-15 22:56:40 +08:00
Nick Fisher 9853d6b721 chore: remove uvScale parameter from SceneManager and add some explicit logging 2024-11-15 22:24:30 +08:00
Nick Fisher 52f041afba chore: move TMaterialInstance FFI methods to own file/header 2024-11-15 22:24:07 +08:00
Nick Fisher 05cb4325da chore: rebuild materials 2024-11-15 22:23:07 +08:00
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
Nick Fisher 6472670ec3 add createRenderTargetRenderThread 2024-11-11 12:49:40 +08:00
Nick Fisher 14b815e009 remove unnecessary _context property from FilamentViewer 2024-11-11 12:49:40 +08:00
Nick Fisher 124938dbc2 temporarily disable UnprojectTexture 2024-11-02 10:23:36 +08:00
Nick Fisher 902f67e97d expose setParameterInt/setParameterFloat4, rename to getScreenSpaceBoundingBox, and expose method for getting renderable bounding box 2024-11-02 10:23:36 +08:00
Nick Fisher 4650ae1295 feat: Rename Gizmo material to UnlitFixedSize, and expose methods for using this material on other entities. Also exposes new methods for setting single float parameters. 2024-11-02 10:23:36 +08:00
Nick Fisher 7c15125a97 fix: reduce size of pick functor for compatibility with armeabi-v7a 2024-10-30 10:47:39 +08:00
Nick Fisher 036369a8dc feat: pass through fragment coordinates for picking 2024-10-30 10:47:39 +08:00
Nick Fisher e5a1585c25 chore: (windows) remove unused libs 2024-10-25 16:44:42 +11:00
Nick Fisher d7debf981c Merge branch 'master' into develop 2024-10-25 14:15:51 +11:00
Nick Fisher 06b20ec6fc fix: properly pass through loadResourcesAsync flag for loadGlbFromBuffer 2024-10-25 10:37:34 +08:00
Nick Fisher f65324e555 chore: cleanup LFS 2024-10-23 15:17:25 +08:00
Nick Fisher 16964b4987 fix:move createUnlitMaterialInstance and createGeometry to render thread 2024-10-23 16:40:55 +11:00
Nick Fisher c4270fc918 fix:move createUnlitMaterialInstance and createGeometry to render thread 2024-10-23 16:38:23 +11:00
Nick Fisher a29a1605a7 chore: rename SceneManager* methods 2024-10-23 16:28:42 +11:00
Nick Fisher 22868a594f fix: dont calculate surface orientation for non-triangle geometry 2024-10-23 16:28:00 +11:00
Nick Fisher cda4027f83 fix!: (windows) add flushAndWait call to capture() to prevent stalling on Windows; use provided buffer as pixelBuffer rather than duplicate allocation 2024-10-23 15:02:28 +11:00
Nick Fisher e2175db7cb fix!: add meshoptimizer lib on Windows 2024-10-23 14:16:03 +11:00
Nick Fisher 8b7c2aa48d fix: set render target to null for each view and then destroy render targets when viewer disposed 2024-10-22 12:42:50 +08:00
Nick Fisher 9bec96f160 chore: rename Viewer_destroyOnRenderThread method and cleanup unused SwapChain parameter in render threa 2024-10-22 12:42:19 +08:00
Nick Fisher a6f5e59cbb fix: move ThermionWin32.h to include 2024-10-14 09:36:28 +08:00
Nick Fisher f9468db266 Windows embedder fixes 2024-10-14 11:23:56 +11:00
Nick Fisher 0ec0fef8f3 move standalone Windows file to extras 2024-10-12 14:55:41 +11:00
Nick Fisher a348562f56 cleanup 2024-10-12 14:36:51 +11:00
Nick Fisher 392a606bbc don't call endFrame() if no views were rendered 2024-10-12 14:36:05 +11:00
Nick Fisher 440bed4485 add files to run standalone Windows 2024-10-12 14:34:42 +11:00