Merge branch 'master' into develop

This commit is contained in:
Nick Fisher
2024-10-25 14:15:51 +11:00
14 changed files with 325 additions and 21 deletions

View File

@@ -3,6 +3,72 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 2024-10-24
### Changes
---
Packages with breaking changes:
- [`thermion_dart` - `v0.2.1-dev.0.0.11`](#thermion_dart---v021-dev0011)
- [`thermion_flutter` - `v0.2.1-dev.10`](#thermion_flutter---v021-dev10)
Packages with other changes:
- [`thermion_flutter_web` - `v0.2.0+1`](#thermion_flutter_web---v0201)
- [`thermion_flutter_platform_interface` - `v0.2.1-dev.10`](#thermion_flutter_platform_interface---v021-dev10)
- [`thermion_flutter_ffi` - `v0.2.1-dev.10`](#thermion_flutter_ffi---v021-dev10)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.2.0+1`
- `thermion_flutter_platform_interface` - `v0.2.1-dev.10`
- `thermion_flutter_ffi` - `v0.2.1-dev.10`
---
#### `thermion_dart` - `v0.2.1-dev.0.0.11`
- **FEAT**: add SCALE2_ROTATE to InputHandler.
- **BREAKING** **FEAT**: expose velocity, rotation and timestamp for scale events in listener. accept rotationSensitivity/zoomSensitivity for FixedOrbitRotateInputHandlerDelegate.
#### `thermion_flutter` - `v0.2.1-dev.10`
- **REFACTOR**: continual refactor to support multiple render targets.
- **FIX**: fix all Windows warnings so apps will compile with /WX.
- **FIX**: use internal Set for determining first ThermionTextureWidget to call requestFrame and cleanup destruction logic.
- **FIX**: (flutter) pass ThermionFlutterOptions to ThermionWidget, use dpr for resizeTexture, delete unnecessary TransparencyPainter class.
- **FIX**: (flutter/web) use window.devicePixelRatio for viewport.
- **FIX**: (flutter) desktop gesture detector changes for new Gizmo methods.
- **FEAT**: (flutter) (windows) add DestroyRenderingSurface method.
- **FEAT**: (flutter) (windows) add DestroyRenderingSurface method.
- **FEAT**: (flutter) (windows) add DestroyRenderingSurface method.
- **FEAT**: (flutter) (windows) add Destroy() to BackingWindow.
- **FEAT**: camera and resizing improvements.
- **FEAT**: support multiple ThermionWidget on Android.
- **FEAT**: use imported texture on iOS.
- **FEAT**: working implementation of multiple widgets on macos.
- **FEAT**: add rendering check to ThermionWidget ticker.
- **FEAT**: allow passing null options to ThermionWidget.
- **FEAT**: (flutter) (web) if importCanvasAsWidget is false, render transparency.
- **FEAT**: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated.
- **FEAT**: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated.
- **FEAT**: highlight gizmo on hover.
- **BREAKING** **FIX**: remove EntityControllerMouseWidget (replace with GestureHandler).
- **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture.
- **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture.
- **BREAKING** **FEAT**: expose velocity, rotation and timestamp for scale events in listener. accept rotationSensitivity/zoomSensitivity for FixedOrbitRotateInputHandlerDelegate.
- **BREAKING** **FEAT**: (web) (flutter) create canvas when createViewer is called (no longer need to manually add canvas element to web HTML).
- **BREAKING** **FEAT**: resize canvas on web.
- **BREAKING** **CHORE**: remove superseded HardwareKeyboard* classes.
- **BREAKING** **CHORE**: (flutter) cleanup for pub.dev publishing.
- **BREAKING** **CHORE**: remove EntityListWidget - will replace with new Scene.
- **BREAKING** **CHORE**: rename controller to viewer in gesture detector widgets.
## 2024-10-23
### Changes

View File

@@ -1,3 +1,178 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bca5e20d7fa68fbc2bb7fa3cd65b07e0ac35c8cf961686cfaa267a941ab96d8f
size 7393
material {
name : unlit_fade,
requires : [ uv0, uv1, color ],
shadingModel : ${SHADINGMODEL},
blending : ${BLENDING},
doubleSided : ${DOUBLESIDED},
transparency : ${TRANSPARENCY},
flipUV : false,
specularAmbientOcclusion : simple,
specularAntiAliasing : true,
clearCoatIorChange : false,
reflections : screenspace,
parameters : [
{ type : float3, name : specularFactor },
{ type : float, name : glossinessFactor },
// Base Color
{ type : int, name : baseColorIndex },
{ type : float4, name : baseColorFactor },
{ type : sampler2d, name : baseColorMap },
{ type : mat3, name : baseColorUvMatrix, precision: high },
// Metallic-Roughness Map
{ type : int, name : metallicRoughnessIndex },
{ type : float, name : metallicFactor },
{ type : float, name : roughnessFactor },
{ type : sampler2d, name : metallicRoughnessMap },
{ type : mat3, name : metallicRoughnessUvMatrix, precision: high },
// Normal Map
{ type : int, name : normalIndex },
{ type : float, name : normalScale },
{ type : sampler2d, name : normalMap },
{ type : mat3, name : normalUvMatrix, precision: high },
// Ambient Occlusion
{ type : int, name : aoIndex },
{ type : float, name : aoStrength },
{ type : sampler2d, name : occlusionMap },
{ type : mat3, name : occlusionUvMatrix, precision: high },
// Emissive Map
{ type : int, name : emissiveIndex },
{ type : float3, name : emissiveFactor },
{ type : float, name : emissiveStrength },
{ type : sampler2d, name : emissiveMap },
{ type : mat3, name : emissiveUvMatrix, precision: high },
// Clear coat
{ type : float, name : clearCoatFactor },
{ type : float, name : clearCoatRoughnessFactor },
{ type : int, name : clearCoatIndex },
{ type : sampler2d, name : clearCoatMap },
{ type : mat3, name : clearCoatUvMatrix, precision: high },
{ type : int, name : clearCoatRoughnessIndex },
{ type : sampler2d, name : clearCoatRoughnessMap },
{ type : mat3, name : clearCoatRoughnessUvMatrix, precision: high },
{ type : int, name : clearCoatNormalIndex },
{ type : sampler2d, name : clearCoatNormalMap },
{ type : mat3, name : clearCoatNormalUvMatrix, precision: high },
{ type : float, name : clearCoatNormalScale },
// Reflectance
{ type : float, name : reflectance }
${CUSTOM_PARAMS}
],
}
vertex {
void materialVertex(inout MaterialVertexInputs material) {
${CUSTOM_VERTEX}
}
}
fragment {
void material(inout MaterialInputs material) {
highp float2 uvs[2];
uvs[0] = getUV0();
uvs[1] = getUV1();
#if !defined(SHADING_MODEL_UNLIT)
if (materialParams.normalIndex > -1) {
highp float2 uv = uvs[materialParams.normalIndex];
uv = (vec3(uv, 1.0) * materialParams.normalUvMatrix).xy;
material.normal = texture(materialParams_normalMap, uv).xyz * 2.0 - 1.0;
material.normal.xy *= materialParams.normalScale;
}
#if defined(SHADING_MODEL_LIT)
if (materialParams.clearCoatNormalIndex > -1) {
highp float2 uv = uvs[materialParams.clearCoatNormalIndex];
uv = (vec3(uv, 1.0) * materialParams.clearCoatNormalUvMatrix).xy;
material.clearCoatNormal = texture(materialParams_clearCoatNormalMap, uv).xyz * 2.0 - 1.0;
material.clearCoatNormal.xy *= materialParams.clearCoatNormalScale;
}
#endif
#endif
prepareMaterial(material);
material.baseColor = materialParams.baseColorFactor;
if (materialParams.baseColorIndex > -1) {
highp float2 uv = uvs[materialParams.baseColorIndex];
uv = (vec3(uv, 1.0) * materialParams.baseColorUvMatrix).xy;
material.baseColor *= texture(materialParams_baseColorMap, uv);
}
#if defined(BLEND_MODE_TRANSPARENT)
material.baseColor.rgb *= material.baseColor.a;
#endif
material.baseColor *= getColor();
#if !defined(SHADING_MODEL_UNLIT)
#if defined(SHADING_MODEL_LIT)
material.roughness = materialParams.roughnessFactor;
material.metallic = materialParams.metallicFactor;
// KHR_materials_clearcoat forbids clear coat from
// being applied in the specular/glossiness model
material.clearCoat = materialParams.clearCoatFactor;
material.clearCoatRoughness = materialParams.clearCoatRoughnessFactor;
if (materialParams.clearCoatIndex > -1) {
highp float2 uv = uvs[materialParams.clearCoatIndex];
uv = (vec3(uv, 1.0) * materialParams.clearCoatUvMatrix).xy;
material.clearCoat *= texture(materialParams_clearCoatMap, uv).r;
}
if (materialParams.clearCoatRoughnessIndex > -1) {
highp float2 uv = uvs[materialParams.clearCoatRoughnessIndex];
uv = (vec3(uv, 1.0) * materialParams.clearCoatRoughnessUvMatrix).xy;
material.clearCoatRoughness *= texture(materialParams_clearCoatRoughnessMap, uv).g;
}
#endif
material.emissive = vec4(materialParams.emissiveStrength *
materialParams.emissiveFactor.rgb, 0.0);
#if defined(SHADING_MODEL_SPECULAR_GLOSSINESS)
material.glossiness = materialParams.glossinessFactor;
material.specularColor = materialParams.specularFactor;
#else
material.reflectance = materialParams.reflectance;
#endif
if (materialParams.metallicRoughnessIndex > -1) {
highp float2 uv = uvs[materialParams.metallicRoughnessIndex];
uv = (vec3(uv, 1.0) * materialParams.metallicRoughnessUvMatrix).xy;
#if defined(SHADING_MODEL_SPECULAR_GLOSSINESS)
vec4 sg = texture(materialParams_metallicRoughnessMap, uv);
material.specularColor *= sg.rgb;
material.glossiness *= sg.a;
#else
vec4 mr = texture(materialParams_metallicRoughnessMap, uv);
material.roughness *= mr.g;
material.metallic *= mr.b;
#endif
}
if (materialParams.aoIndex > -1) {
highp float2 uv = uvs[materialParams.aoIndex];
uv = (vec3(uv, 1.0) * materialParams.occlusionUvMatrix).xy;
float occlusion = texture(materialParams_occlusionMap, uv).r;
material.ambientOcclusion = 1.0 + materialParams.aoStrength * (occlusion - 1.0);
}
if (materialParams.emissiveIndex > -1) {
highp float2 uv = uvs[materialParams.emissiveIndex];
uv = (vec3(uv, 1.0) * materialParams.emissiveUvMatrix).xy;
material.emissive.rgb *= texture(materialParams_emissiveMap, uv).rgb;
}
#endif
${CUSTOM_FRAGMENT}
}
}

View File

@@ -1,3 +1,10 @@
## 0.2.1-dev.0.0.11
> Note: This release has breaking changes.
- **FEAT**: add SCALE2_ROTATE to InputHandler.
- **BREAKING** **FEAT**: expose velocity, rotation and timestamp for scale events in listener. accept rotationSensitivity/zoomSensitivity for FixedOrbitRotateInputHandlerDelegate.
## 0.2.1-dev.0.0.10
> Note: This release has breaking changes.

View File

@@ -796,14 +796,23 @@ abstract class ThermionViewer {
Future<Aabb2> getViewportBoundingBox(ThermionEntity entity);
///
/// Filament assigns renderables to a numeric layer.
/// We place all scene assets in layer 0 (enabled by default), gizmos in layer 1 (enabled by default), world grid in layer 2 (disabled by default).
/// Use this method to toggle visibility of the respective layer.
/// Toggles the visibility of the respective layer.
///
Future setLayerVisibility(int layer, bool visible);
///
/// Assigns [entity] to visibility layer [layer].
/// All renderable entities are assigned a layer mask.
///
/// By calling [setLayerVisibility], all renderable entities allocated to
/// the given layer can be efficiently hidden/revealed.
///
/// By default, all renderable entities are assigned to layer 0 (and this
/// layer is enabled by default). Call [setVisibilityLayer] to change the
/// layer for the specified entity.
///
/// Note that we currently also assign gizmos to layer 1 (enabled by default)
/// and the world grid to layer 2 (disabled by default). We suggest you avoid
/// using these layers.
///
Future setVisibilityLayer(ThermionEntity entity, int layer);

View File

View File

@@ -1,6 +1,6 @@
name: thermion_dart
description: 3D rendering toolkit for Dart.
version: 0.2.1-dev.0.0.10
version: 0.2.1-dev.0.0.11
homepage: https://thermion.dev
repository: https://github.com/nmfisher/thermion

View File

@@ -1,3 +1,38 @@
## 0.2.1-dev.10
> Note: This release has breaking changes.
- **REFACTOR**: continual refactor to support multiple render targets.
- **FIX**: fix all Windows warnings so apps will compile with /WX.
- **FIX**: use internal Set for determining first ThermionTextureWidget to call requestFrame and cleanup destruction logic.
- **FIX**: (flutter) pass ThermionFlutterOptions to ThermionWidget, use dpr for resizeTexture, delete unnecessary TransparencyPainter class.
- **FIX**: (flutter/web) use window.devicePixelRatio for viewport.
- **FIX**: (flutter) desktop gesture detector changes for new Gizmo methods.
- **FEAT**: (flutter) (windows) add DestroyRenderingSurface method.
- **FEAT**: (flutter) (windows) add DestroyRenderingSurface method.
- **FEAT**: (flutter) (windows) add DestroyRenderingSurface method.
- **FEAT**: (flutter) (windows) add Destroy() to BackingWindow.
- **FEAT**: camera and resizing improvements.
- **FEAT**: support multiple ThermionWidget on Android.
- **FEAT**: use imported texture on iOS.
- **FEAT**: working implementation of multiple widgets on macos.
- **FEAT**: add rendering check to ThermionWidget ticker.
- **FEAT**: allow passing null options to ThermionWidget.
- **FEAT**: (flutter) (web) if importCanvasAsWidget is false, render transparency.
- **FEAT**: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated.
- **FEAT**: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated.
- **FEAT**: highlight gizmo on hover.
- **BREAKING** **FIX**: remove EntityControllerMouseWidget (replace with GestureHandler).
- **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture.
- **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture.
- **BREAKING** **FEAT**: expose velocity, rotation and timestamp for scale events in listener. accept rotationSensitivity/zoomSensitivity for FixedOrbitRotateInputHandlerDelegate.
- **BREAKING** **FEAT**: (web) (flutter) create canvas when createViewer is called (no longer need to manually add canvas element to web HTML).
- **BREAKING** **FEAT**: resize canvas on web.
- **BREAKING** **CHORE**: remove superseded HardwareKeyboard* classes.
- **BREAKING** **CHORE**: (flutter) cleanup for pub.dev publishing.
- **BREAKING** **CHORE**: remove EntityListWidget - will replace with new Scene.
- **BREAKING** **CHORE**: rename controller to viewer in gesture detector widgets.
## 0.2.1-dev.9
> Note: This release has breaking changes.

View File

@@ -1,6 +1,6 @@
name: thermion_flutter
description: Flutter plugin for 3D rendering with the Thermion toolkit.
version: 0.2.1-dev.9
version: 0.2.1-dev.10
homepage: https://thermion.dev
repository: https://github.com/nmfisher/thermion
@@ -17,10 +17,10 @@ dependencies:
plugin_platform_interface: ^2.0.0
ffi: ^2.1.2
animation_tools_dart: ^0.1.0
thermion_dart: ^0.2.1-dev.0.0.10
thermion_flutter_platform_interface: ^0.2.1-dev.9
thermion_flutter_ffi: ^0.2.1-dev.9
thermion_flutter_web: ^0.2.0
thermion_dart: ^0.2.1-dev.0.0.11
thermion_flutter_platform_interface: ^0.2.1-dev.10
thermion_flutter_ffi: ^0.2.1-dev.10
thermion_flutter_web: ^0.2.0+1
logging: ^1.2.0
web: ^1.0.0

View File

@@ -1,3 +1,7 @@
## 0.2.1-dev.10
- Update a dependency to the latest release.
## 0.2.1-dev.9
> Note: This release has breaking changes.

View File

@@ -1,7 +1,7 @@
name: thermion_flutter_ffi
description: An FFI implementation for thermion_flutter (i.e. all platforms except web).
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
version: 0.2.1-dev.9
version: 0.2.1-dev.10
environment:
sdk: ">=3.3.0 <4.0.0"
@@ -23,8 +23,8 @@ dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.1.0
thermion_flutter_platform_interface: ^0.2.1-dev.9
thermion_dart: ^0.2.1-dev.0.0.10
thermion_flutter_platform_interface: ^0.2.1-dev.10
thermion_dart: ^0.2.1-dev.0.0.11
logging: ^1.2.0
dev_dependencies:

View File

@@ -1,3 +1,7 @@
## 0.2.1-dev.10
- Update a dependency to the latest release.
## 0.2.1-dev.9
> Note: This release has breaking changes.

View File

@@ -1,7 +1,7 @@
name: thermion_flutter_platform_interface
description: A common platform interface for the thermion_flutter plugin.
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
version: 0.2.1-dev.9
version: 0.2.1-dev.10
environment:
sdk: ">=3.3.0 <4.0.0"
@@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.1.0
thermion_dart: ^0.2.1-dev.0.0.10
thermion_dart: ^0.2.1-dev.0.0.11
dev_dependencies:
flutter_test:

View File

@@ -1,3 +1,7 @@
## 0.2.0+1
- Update a dependency to the latest release.
## 0.2.0
> Note: This release has breaking changes.

View File

@@ -1,7 +1,7 @@
name: thermion_flutter_web
description: A web platform interface for the thermion_flutter plugin.
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
version: 0.2.0
version: 0.2.0+1
environment:
sdk: ">=3.3.0 <4.0.0"
@@ -20,8 +20,8 @@ dependencies:
sdk: flutter
plugin_platform_interface: ^2.1.0
web: ^1.0.0
thermion_dart: ^0.2.1-dev.0.0.10
thermion_flutter_platform_interface: ^0.2.1-dev.9
thermion_dart: ^0.2.1-dev.0.0.11
thermion_flutter_platform_interface: ^0.2.1-dev.10
flutter_web_plugins:
sdk: flutter