Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS Refactor. #86

Merged
merged 35 commits into from
Sep 24, 2024
Merged

ECS Refactor. #86

merged 35 commits into from
Sep 24, 2024

Commits on Mar 8, 2024

  1. Configuration menu
    Copy the full SHA
    a515e22 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2024

  1. Configuration menu
    Copy the full SHA
    5bef663 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2024

  1. World for hosting all nodes of different comps of a puppet.

    Safe interfaces of `AnyVec` removed, as tested and usage constrained.
    Richardn2002 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    d52f4ff View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2024

  1. Major ECS refactor.

    Inochi2D node types into Inox2D components, see comments in `node/components.rs`.
    `Puppet` as self-managed struct, reads INP file into a tree of nodes and a world of components to construct self.
    No `Copy/Clone` on `InoxNode`, components and `JsonValue`, cutting Aka.inp loading time to 1/3.
    Richardn2002 committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    492c894 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2024

  1. Configuration menu
    Copy the full SHA
    ea6d2f7 View commit details
    Browse the repository at this point in the history
  2. RenderCtx with components in mind. Init and reading methods.

    Storing absolute transforms is no longer RenderCtx's job.
    Put graphics buffer stuff to a seperate file.
    Richardn2002 committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    032181f View commit details
    Browse the repository at this point in the history
  3. Componentize render contexts and store them in puppets.

    Should be easy for incorporating future renderable node types.
    Richardn2002 committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    2746a6c View commit details
    Browse the repository at this point in the history
  4. Complete render.rs rewrite.

    Get required data from components instead.
    Changes to the renderer traits:
    - remove `render()`
    - `on_begin_mask()` -> `on_begin_masks()`
    - `set_mask_mode()` -> `on_begin_mask()`
    - `draw_mesh_self()` -> `draw_textured_mesh_content()`
    - `draw_part()` -> `draw_drawable()`
    Richardn2002 committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    9bd7c4d View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2024

  1. Configuration menu
    Copy the full SHA
    08cccb6 View commit details
    Browse the repository at this point in the history
  2. Pass InoxNodeUuid of the node in question to draw calls in case som…

    …e backend gets smart.
    
    For example reusing some results for a same node.
    Richardn2002 committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    3cc6f64 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2024

  1. Deformations by parameters.

    Enum `Deform` and `DeformSrc` to get prepared for Meshgroup implementation.
    One `DeformStack` per deform-able node for combining multiple deforms in a controlled way.
    Drawable related stuff, especially the drawable kind determination logic, moved to its own places from `render.rs`, as apparently other systems (parameters for example) may want to know is a node a drawable.
    Richardn2002 committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    1cfa783 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2024

  1. Components to store zsorts and transforms that are being modified acr…

    …oss frames.
    
    so that `InoxNode` stores constant initial values.
    Richardn2002 committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    3ffdb23 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    537b75a View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2024

  1. Param init and set.

    The same reasoning behind `ctx` structs: Any data not in a model file is additional context data for certain functionalities, which should be only initialized upon demand.
    End users only reset and set the values of params. When and how to actually apply params per frame is up to this library.
    Removed `physics_ctx` placeholder that is present on local but should not be published.
    Richardn2002 committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    49111a7 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2024

  1. Implement reset methods for puppet to run across frames.

    General pattern for a "system": Takes the form of an optional `-Ctx` struct attached to a puppet, which can be initialized if dependencies met.
    Interactions with the puppet data are done in methods of the struct, so a `None` system can do nothing.
    Current systems: Transform, Param, Render.
    Richardn2002 committed Jul 28, 2024
    Configuration menu
    Copy the full SHA
    e08b1ca View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. render-opengl compiles.

    With parameters and ECS system in place.
    Changes to `trait InoxRenderer` during implementation:
    - `new()` can have custom params.
    - `on_begin_draw()` and `on_end_draw()`
    Make `vao` creation, binding and unbinding, and vbo attaching, more explicit.
    Move previous OpenGL `InoxRenderer` implementation into new framework.
    Remove duplicate shader bind and uniform uploads during iteration over masks for a node (do once inside `on_begin_masks()`).
    Richardn2002 committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    54e1098 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    30ecda4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6050b79 View commit details
    Browse the repository at this point in the history
  4. Fix uninitialized zsort.

    Richardn2002 committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    fc3ab0d View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Fix zsort, thus rendering is back for Aka.inp.

    Properly implement zsort inheritance (+).
    Correctly exclude composite children from `root_drawables_zsorted`.
    Turn off param application temporarily, so this commit works for `Aka.inp`.
    Richardn2002 committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    00725d6 View commit details
    Browse the repository at this point in the history
  2. Params (and deforms) back online: Dirty zero check patching for an ol…

    …d bug.
    
    Currently, overflow will happen if value (0, 0) is applied on a param, which is clearly a bug.
    The actual fix is not in the scope of ECS refactor.
    Richardn2002 committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    c1ade82 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Physics cleanup.

    The philosophy of the ECS refactor naturally leads to this cleanup:
    In this refactor, spec-defined variables either goes into `InoxNode` or a component. If there are additional variables needed for the execution of a certain module, they are attached as additional components later.
    It is revealed that bob position of a pendulum is such a variable.
    After cleanup, all pendulum-like systems can provide methods for accessing and updating their bobs' position, implementing `trait Pendulum`.
    And then `trait SimplePhysicsCtx` will be auto implemented for all `impl Pendulum`, handling the mapping from transforms to simulation input, from simulation input to parameter values.
    More comments are added.
    Richardn2002 committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    5e03996 View commit details
    Browse the repository at this point in the history
  2. Physics back online.

    The implementation is inefficient (check changes in `puppet.rs`), yes, but clear, and the bottleneck is not here anyways.
    Cloning of `SimplePhysics` is required for working around ownership problems, until dark magic implemented on `World` enabling multiple mutable handles to different components.
    Richardn2002 committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    d3c3d02 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2024

  1. DeformSrc -> DeformSource

    And suppress variant unused warning... until Meshgroups.
    Richardn2002 committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    51a2c4a View commit details
    Browse the repository at this point in the history
  2. Put all components into compoents.rs.

    Responding to Inochi2D#86 (comment)
    Rename `ParamMapMode` to `PhysicsParamMapMode` for this change for clarity.
    Richardn2002 committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    fa1ab36 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2024

  1. Configuration menu
    Copy the full SHA
    912782d View commit details
    Browse the repository at this point in the history
  2. Better safety specifications related to GL buffer operations.

    In response to Inochi2D#86 (comment)
    Plus more robust `upload_array_to_gl()`, with more annotations inside.
    Richardn2002 committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    76b03d2 View commit details
    Browse the repository at this point in the history
  3. Remove new() from trait InoxRenderer.

    In response to Inochi2D#86 (comment)
    ...and why `Sized` is required in the first place?
    Richardn2002 committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    e6e399c View commit details
    Browse the repository at this point in the history
  4. Better on_begin_draw() on_end_draw() draw() interfaces.

    In response to Inochi2D#86 (comment)
    The core crate does not need to know about the presence of stuff to do before and after `draw()`. This is up to renderer implementations.
    Richardn2002 committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    599090a View commit details
    Browse the repository at this point in the history
  5. tracing::warn!() instead of panic!() on non-standard component co…

    …mbinations for a Drawable.
    
    In response to Inochi2D#86 (comment)
    Richardn2002 committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    aff042e View commit details
    Browse the repository at this point in the history
  6. Do not give TexturedMesh that is not going to be deformed by any so…

    …urce a `DeformStack`.
    
    Thus accordingly, fewer `DeformStack` resetting and reading will happen.
    Optimization inspired by Inochi2D#86 (comment)
    Richardn2002 committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    69549f9 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2024

  1. Generalize Mesh into a standalone component.

    For future meshgroup implementation.
    Richardn2002 committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    7f4c9c0 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2024

  1. Configuration menu
    Copy the full SHA
    45f6a36 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2024

  1. Configuration menu
    Copy the full SHA
    fc39a26 View commit details
    Browse the repository at this point in the history
  2. Fix WebGL example

    Speykious committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    21136c2 View commit details
    Browse the repository at this point in the history