MCPcopy Index your code
hub / github.com/Inochi2D/inox2d

github.com/Inochi2D/inox2d @v0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.0 ↗ · + Follow
365 symbols 777 edges 40 files 29 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Inox2D

<img width="200" height="256" src="https://github.com/Inochi2D/inox2d/raw/v0.3.0/inox2d_logo.svg">

Officially supported experimental Rust port of Inochi2D.   Discord

 

The Inox2D workgroup provides support in the #inox2d channel on the Inochi2D Discord.

Currently this library and the specification is in a prototype state, it is not recommended to use this library in production.

 

Rigging

If you're a model rigger you may want to check out Inochi Creator, the official Inochi2D rigging app in development.
This repository is purely for developers and is not useful if you're an end user.

 

Status

Both INP and INX files get parsed correctly.

Both renderers (OpenGL, WGPU) now work on all models we could test them on (Aka, Midori, Arch-chan). The newer models which use the MeshGroup feature don't work yet though.

Support for mesh groups and animations is on the way!

Feature tree

  • [x] Parsing
  • [x] INP format
  • [x] INX format
  • [x] Rendering
  • [x] OpenGL
    • [x] WASM (WebGL)
  • [x] WGPU
    • [ ] WASM (WebGL)
  • [ ] Draw List
  • [x] Parameters
  • [x] Deforms (mesh vertex offsets)
  • [x] Values (node transform offsets)
  • [ ] Z-sort
  • [x] Physics
  • [ ] Animations
  • [ ] Mesh groups

INP and INX parsing

cargo run -p inox2d --features owo --example parse-inp path/to/puppet.inp

Parsed foxgirl

OpenGL renderer

cargo run -p render-opengl path/to/puppet.inp

OpenGL-rendered Arch-chan

WebGL demo

See the render_webgl example.

WebGL-rendered Aka

WGPU renderer

cargo run -p render-wgpu path/to/puppet.inp

WGPU-rendered Arch-chan

 

Implementation

Inox2D aims to support all features currently present in the standard D implementation.

Inox2D is designed to be extensible. Nodes are extensible through a generic InoxData<T> enum which has a Custom(T) variant. Every other part of the library accounts for it: the OpenGL renderer accepts any struct that implements the CustomRenderer trait to be able to render your custom nodes, and the deserialization functions accept generic Fns for deserialization of custom nodes when it is relevant.

 

Optimization on OpenGL

Implementation language OpenGL calls
Inochi2D reference* D 3076
Link Mauve's inochi2d Rust 551
Inox2D Rust 1639

The OpenGL renderer on Inox2D has a few simple optimizations that result in fewer OpenGL calls:

  • it uses a simple OpenGL cache to avoid making calls when the resulting state won't change,
  • it only uploads a model's part textures once instead of every frame.

* Reference implementation is subject to change as optimisation passes are done, additionally code is more geared towards readability than performance for implementers to be able to more easily use it as reference.

 

License

This project is licensed under the 2-Clause BSD license. See LICENSE for details.

Extension points exported contracts — how you extend this code

IsPhysicsVars (Interface)
(no doc) [2 implementers]
inox2d/src/physics/runge_kutta.rs
RenderCtxOpenglExt (Interface)
(no doc) [1 implementers]
inox2d-opengl/src/gl_buffer.rs
App (Interface)
(no doc) [1 implementers]
examples/render-opengl/src/app_frame.rs
InoxRenderer (Interface)
(no doc) [1 implementers]
inox2d/src/render.rs
InoxRendererCommon (Interface)
(no doc) [1 implementers]
inox2d/src/render.rs
SerialExtend (Interface)
(no doc) [1 implementers]
inox2d/src/formats/json.rs

Core symbols most depended-on inside this repo

get
called by 34
inox2d/src/math/matrix.rs
push
called by 17
inox2d/src/render.rs
get_list
called by 14
inox2d/src/formats/json.rs
get_str
called by 13
inox2d/src/formats/json.rs
get_number
called by 12
inox2d/src/formats/json.rs
get_node
called by 12
inox2d/src/node/tree.rs
writeln_opt
called by 10
inox2d/src/puppet.rs
get_f32
called by 10
inox2d/src/formats/json.rs

Shape

Method 198
Function 80
Class 64
Enum 17
Interface 6

Languages

Rust100%

Modules by API surface

inox2d-opengl/src/lib.rs33 symbols
inox2d/src/formats/payload.rs32 symbols
inox2d/src/formats/json.rs26 symbols
inox2d/src/node/data.rs23 symbols
inox2d/src/mesh.rs23 symbols
inox2d/src/math/interp.rs18 symbols
inox2d/src/puppet.rs16 symbols
inox2d/src/node/tree.rs16 symbols
inox2d/src/params.rs15 symbols
inox2d/src/render.rs14 symbols
inox2d-opengl/src/shaders.rs13 symbols
inox2d-opengl/src/texture.rs11 symbols

For agents

$ claude mcp add inox2d \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact