chore: update quickstart

This commit is contained in:
Nick Fisher
2024-10-22 22:22:30 +08:00
parent e27a8ee601
commit 39762c8132

View File

@@ -79,6 +79,13 @@ class _MyHomePageState extends State<MyHomePage> {
await _thermionViewer!.loadSkybox("assets/default_env_skybox.ktx"); await _thermionViewer!.loadSkybox("assets/default_env_skybox.ktx");
await _thermionViewer!.loadIbl("assets/default_env_ibl.ktx"); await _thermionViewer!.loadIbl("assets/default_env_ibl.ktx");
// The underlying Filament rendering engine exposes a number of
// post-processing options (anti-aliasing, bloom, etc).
// Post-processing is disabled by default, but most users will want to
// enable it for color correction.
// If you're not sure what you're doing, always set this to true.
await _thermionViewer!.setPostProcessing(true);
// Finally, you need to explicitly enable rendering. Setting rendering to // Finally, you need to explicitly enable rendering. Setting rendering to
// false is designed to allow you to pause rendering to conserve battery life // false is designed to allow you to pause rendering to conserve battery life
await _thermionViewer!.setRendering(true); await _thermionViewer!.setRendering(true);
@@ -87,7 +94,7 @@ class _MyHomePageState extends State<MyHomePage> {
} }
Future _unload() async { Future _unload() async {
// when you are no longer need the 3D viewport: // when you've finished rendering and you no longer need a 3D viewport:
// 1) remove all instances of ThermionWidget from the widget tree // 1) remove all instances of ThermionWidget from the widget tree
// 2) remove all local references to the ThermionViewer // 2) remove all local references to the ThermionViewer
// 3) call dispose on the ThermionViewer // 3) call dispose on the ThermionViewer
@@ -120,14 +127,14 @@ class _MyHomePageState extends State<MyHomePage> {
Align( Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Padding( child: Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child:Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
if (_thermionViewer == null) _loadButton(), if (_thermionViewer == null) _loadButton(),
if (_thermionViewer != null) _unloadButton(), if (_thermionViewer != null) _unloadButton(),
]))) ])))
]); ]);
} }
} }