flutter3d_level_scene 1.0.0-rc.1 copy "flutter3d_level_scene: ^1.0.0-rc.1" to clipboard
flutter3d_level_scene: ^1.0.0-rc.1 copied to clipboard

A flutter3d level document turned into a scene: brushes into meshes, level materials into engine ones, lights, probes, decals, mirrors and camera screens into nodes.

flutter3d_level_scene #

A flutter3d level document turned into a scene, in plain Dart.

  • LevelScene.build: the level's brushes as uploaded meshes, batched per material (LevelBatching.perMaterial, what a game draws with) or per brush (LevelBatching.perBrush, so a pixel names the brush it belongs to); its lights, reflection probes, decals, mirrors and camera screens as nodes. The answer is a LevelSceneParts: the scene, and the parts of it a caller keeps to rebuild, cull or release.
  • LevelScene.materialFrom: a level material as an engine material, the one place that knows both.
  • meshDataOf: a BrushSurface interleaved into the engine's standard vertex layout, for the brushes and for terrain.

Nothing here reads a file. The textures a level names and the .fmat materials it defers to are loaded by the caller and handed in already on the device; a caller with neither hands nothing, and every surface is drawn in the numbers the document carries.

import 'package:flutter3d_level_scene/flutter3d_level_scene.dart';
import 'package:flutter3d_sim/flutter3d_sim.dart';

final parts = const LevelScene().build(
  Level.fromJson(document),
  device: device,
);
final scene = parts.scene; // the brushes, lights and probes, ready to draw

flutter3d_app's LevelLoader is built on this, with the asset bundle and the image decoder in front of it; the level editor's light optimizer and its agent server use it with no window at all. Until 1.0.0-rc.1 it was part of flutter3d_editor_core.

0
likes
140
points
55
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A flutter3d level document turned into a scene: brushes into meshes, level materials into engine ones, lights, probes, decals, mirrors and camera screens into nodes.

Topics

#game-development #game-engine #level-editor #graphics

License

MIT (license)

Dependencies

flutter3d_core, flutter3d_foundation, flutter3d_hardware, flutter3d_matter, flutter3d_sim, vector_math

More

Packages that depend on flutter3d_level_scene