Skip to content

v0.3.4

Pre-release
Pre-release
Compare
Choose a tag to compare
@mkeeter mkeeter released this 26 Dec 15:34
· 15 commits to main since this release
e2d6698
  • Add GenericVmFunction::simplify_with to simultaneously simplify a function and pick a new register count for the resulting tape
  • Add bidirectional conversions between JitFunction and GenericVmFunction (exposing the inner data member)
  • Add a new TileSizes(Vec<usize>) object representing tile sizes used during rendering. Unlike the previous Vec<usize>, this data type checks our tile size invariants at construction. It is used in the struct RenderConfig.
  • Rethink rendering and viewport configuration:
    • Add a new RegionSize<const N: usize> type (with ImageSize and VoxelSize aliases), representing a render region. This type is responsible for the screen-to-world transform
    • Add View2 and View3 types, which stores the world-to-model transform (scaling, panning, etc)
    • Image rendering uses both RegionSize and ViewX; this means that we can now render non-square images!
    • Meshing uses just a View3, to position the model within the ±1 bounds
    • The previous fidget::shape::Bounds type is removed
    • Remove fidget::render::render2d/3d from the public API, as they're equivalent to the functions on ImageRenderConfig / VoxelRenderConfig
  • Move RenderHints into fidget::render
  • Remove fine-grained features from fidget crate, because we aren't actually testing the power-set of feature combinations in CI (and some were breaking!). The only remaining features are rhai, jit and eval-tests.
  • Add new ShapeVars<T> type, representing a map from VarIndex -> T. This type is used for high-level rendering and meshing of Shape objects that include supplementary variables
  • Add Octree::build_with_vars and Image/VoxelRenderConfig::run_with_vars functions for shapes with supplementary variables
  • Change ShapeBulkEval::eval_v to take single variables (i.e. x, y, z vary but each variable has a constant value across the whole slice). Add ShapeBulkEval::eval_vs if x, y, z and variables are all changing through the slices.
  • Add a new GenericVmTape<N> type, and use it for VM evaluation. Previously, the GenericVmFunction<N> type implemented both Tape and Function.
  • Add vars() to Function trait, because there are cases where we want to get the variable map without building a tape (and it must always be the same).
  • Fix soundness bug in Mmap (probably not user-visible)
  • Add Send + Sync + Clone bounds to the trait Tape, to make them easily shared between threads. Previously, we used an Arc<Tape> to share tapes between threads, but tapes were already using an Arc<..> under the hood.
  • Changed Tape::recycle from returning a Storage to returning an Option<Storage>, as tapes may now be shared between threads.
  • Use Rayon for 2D and 3D rasterization
    • The threads member of VoxelRenderConfig and ImageRenderConfig is now a Option<ThreadPool>, which can be None (use a single thread), Some(ThreadPool::Global) (use the global Rayon pool), or Some(ThreadPool::Custom(..)) (use a user-provided pool)
    • This is a step towards WebAssembly multithreading, using wasm-bindgen-rayon.
    • ThreadCount is moved to fidget::mesh, because that's the only place it's now used
      • The plan is to switch to Rayon for meshing as well, eventually
  • Tweak View2 and View3 APIs to make them more useful as camera types