heyx3 / BpWorld

A Test game for OpenGL experiments with the Julia port of B+
1 stars 0 forks source link

Usability: Voxel layer assets #15

Closed heyx3 closed 1 year ago

heyx3 commented 2 years ago
  1. Improve the data format for specifying texture parameters. Maybe refactor it to allow for many kinds of parameters, which the GUI could then display.
  2. Make the process for loading voxel assets more fault-tolerant -- instead of throwing, report the error and fall back to "error" shader and/or textures.
  3. Document the process for adding new assets.
  4. Integrate all this into the GUI: a. Report the different loaded assets b. Offer a live preview of each asset c. In the scene, let the user tweak the parameters of each asset d. Offer a "reload" button for each asset
heyx3 commented 1 year ago
  1. Automatically reload the asset whenever it or its textures changes on disk. Offer a GUI a checkbox to disable this behavior.
heyx3 commented 1 year ago

Finished the first version of this work.

I decided that there will not be a GUI for layer stuff; instead they will continue to be hand-edited in text editors, and referenced in the scene file using preprocessor-like commands (#layer 1 rock/rock.json). In the future, as more data is included in scene files (fog, fluids) we will probably need to add a whole data format on top of the voxel DSL, as we can't do everything in preprocessor-style commands.

Layer materials are cached, so that they're not reloaded every time the scene file changes. If a material fails to load, it preserves the previous compiled version.

There is a fallback "error material" if layer renderers fail to compile the first time.

Because none of the layer stuff will be in the GUI, a checkbox for disabling automatic layer updates from disk feels like a bad idea. There's no way to manually force a layer to reload.