expose setToneMapping method

This commit is contained in:
Nick Fisher
2023-08-24 09:29:16 +08:00
parent 7687e54a0d
commit 482666da31
6 changed files with 51 additions and 8 deletions

View File

@@ -13,6 +13,8 @@ typedef AssetManager = int;
typedef FilamentEntity = int;
const FilamentEntity FILAMENT_ASSET_ERROR = 0;
enum ToneMapper { ACES, FILMIC, LINEAR }
class FilamentController {
late MethodChannel _channel = MethodChannel("app.polyvox.filament/event");
@@ -358,6 +360,12 @@ class FilamentController {
}
}
void setToneMapping(ToneMapper mapper) async {
if (!await _channel.invokeMethod("setToneMapping", mapper.index)) {
throw Exception("Failed to set tone mapper");
}
}
void setCameraFocalLength(double focalLength) async {
await _channel.invokeMethod("setCameraFocalLength", focalLength);
}