Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4a1f2eb
InoxRenderer should always be mutable in its self methods.
ArcturusEmrys Feb 16, 2026
96f52c0
Make `on_begin_draw`/`on_end_draw` official InoxRenderer trait methods.
ArcturusEmrys Feb 23, 2026
3e7968f
Break InoxRenderer into a separate renderer and draw-session trait.
ArcturusEmrys Feb 24, 2026
1da8d35
`DrawSessionExt` methods should have access to the puppet being rende…
ArcturusEmrys Feb 23, 2026
c368e65
Fix webGL renderer
ArcturusEmrys Feb 25, 2026
1b2b5f8
Add a stub of a WGPU renderer.
ArcturusEmrys Feb 14, 2026
67cf864
First attempt at a SPIR-V shim generator
ArcturusEmrys Feb 14, 2026
fac7575
Autogenerate module files for the shaders as well
ArcturusEmrys Feb 14, 2026
88ad2f1
Add automatic copy to uniform buffer to generated shader types
ArcturusEmrys Feb 14, 2026
446a40a
Add support for autogenerated bind group layouts
ArcturusEmrys Feb 16, 2026
5fbe0e9
Shader blocks should write to a user-provided buffer slice
ArcturusEmrys Feb 16, 2026
6305f51
Add bind method to generate bind groups for shaders
ArcturusEmrys Feb 16, 2026
04cf242
Add a method to access a Shader's bind group layout
ArcturusEmrys Feb 16, 2026
e2069b5
Add traits for shaders.
ArcturusEmrys Feb 16, 2026
d32e3a6
Turns out descriptor sets are actually very important.
ArcturusEmrys Feb 16, 2026
b8e7151
Add a pipeline abstraction and make one out of our Part shaders.
ArcturusEmrys Feb 16, 2026
dd24f33
Also make the composite pipelines, too.
ArcturusEmrys Feb 16, 2026
49a7c8f
Add a trait for uniform block buffer generation
ArcturusEmrys Feb 16, 2026
2d9ce9d
Stub impl of InoxRenderer for WGPU.
ArcturusEmrys Feb 16, 2026
52d5da8
It turns out combined image/samplers are forbidden in WGPU land, so r…
ArcturusEmrys Feb 19, 2026
9861a28
Upload all model textures at renderer init
ArcturusEmrys Feb 19, 2026
7d628ef
Use uploaded model texturers in the render passes we've already written
ArcturusEmrys Feb 19, 2026
608c577
Add a type to manage our internal render targets
ArcturusEmrys Feb 19, 2026
fc1353b
Tie GBuffer into all our render passes
ArcturusEmrys Feb 19, 2026
5f4a143
Add target outputs to all our fragment shaders
ArcturusEmrys Feb 19, 2026
a830a49
Upload Inox vertex buffers
ArcturusEmrys Feb 21, 2026
2ef98e8
Publish location constants
ArcturusEmrys Feb 21, 2026
729ad92
Finish the normal rendering pass
ArcturusEmrys Feb 21, 2026
5dbabae
Implement use of stencil buffer for masking
ArcturusEmrys Feb 21, 2026
4d6ffcd
Silence some Rust warnings
ArcturusEmrys Feb 22, 2026
b8490af
Fragment shaders now expose a type for their blend states.
ArcturusEmrys Feb 22, 2026
22b6556
Add `PipelineGroup` to cache different blend/stencil variants of a gi…
ArcturusEmrys Feb 22, 2026
ac72d72
`self.is_in_mask` should be flagged with `InoxRenderer.on_begin_maske…
ArcturusEmrys Feb 22, 2026
2a9456d
Add option to configure write mask as our mask shaders are supposed t…
ArcturusEmrys Feb 22, 2026
bee8ce1
Use the actual texture clear command
ArcturusEmrys Feb 22, 2026
94ef214
Pedantry: these are textures, not buffers.
ArcturusEmrys Feb 22, 2026
7b309b0
Add support for rendering to the surface texture directly.
ArcturusEmrys Feb 22, 2026
92fda8b
Implement composite begin/end
ArcturusEmrys Feb 22, 2026
4dcbc58
Make `on_begin_draw`/`on_end_draw` official InoxRenderer trait methods.
ArcturusEmrys Feb 23, 2026
d5a9b9c
We should present at the end of drawing
ArcturusEmrys Feb 23, 2026
afa15d6
Add an example program that uses the WGPU renderer
ArcturusEmrys Feb 23, 2026
b55b6e9
Break InoxRenderer into a separate renderer and draw-session trait.
ArcturusEmrys Feb 24, 2026
1f48dea
Cargo fmt the example wgpu renderer app
ArcturusEmrys Feb 24, 2026
2501d8c
Request clamp-to-border and clear texture features
ArcturusEmrys Mar 21, 2026
ac67ed8
We apparently need to blend on RGBA32float textures
ArcturusEmrys Mar 22, 2026
64a0583
Run a frame before rendering to ensure all components are setup
ArcturusEmrys Mar 22, 2026
76beace
Ensure each pipeline has a label including the names of its vertex an…
ArcturusEmrys Mar 22, 2026
1e7751c
Ask for a higher limit of color attachment bytes
ArcturusEmrys Mar 22, 2026
e1ecc29
Sampled images should have the correct data type
ArcturusEmrys Mar 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ resolver = "2"
members = [
"inox2d",
"inox2d-opengl",
"inox2d-wgpu",
"examples/*",
]
4 changes: 1 addition & 3 deletions examples/render-opengl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ impl App for Inox2dOpenglExampleApp {
// Just that physics simulation will run for the provided time, which may be big and causes a startup delay.
puppet.end_frame(scene_ctrl.dt());

renderer.on_begin_draw(puppet);
renderer.draw(puppet);
renderer.on_end_draw(puppet);
renderer.draw(puppet).expect("successful draw");
}

fn handle_window_event(&mut self, event: WindowEvent, elwt: &EventLoopWindowTarget<()>) {
Expand Down
4 changes: 1 addition & 3 deletions examples/render-webgl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
// Just that physics simulation will run for the provided time, which may be big and causes a startup delay.
puppet.end_frame(scene_ctrl.borrow().dt());

renderer.borrow().on_begin_draw(&puppet);
renderer.borrow().draw(&puppet);
renderer.borrow().on_end_draw(&puppet);
renderer.borrow_mut().draw(&puppet);
}

request_animation_frame(anim_loop_f.borrow().as_ref().unwrap());
Expand Down
14 changes: 14 additions & 0 deletions examples/render-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "render-wgpu"
version = "0.1.0"
edition = "2024"

[dependencies]
common = { path = "../common" }
inox2d = { path = "../../inox2d" }
inox2d-wgpu = { path = "../../inox2d-wgpu"}
winit = "0.29"
env_logger = "0.11.9"
log = "0.4.29"
clap = { version = "4.1.8", features = ["derive"] }
pollster = "0.4.0"
94 changes: 94 additions & 0 deletions examples/render-wgpu/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
use clap::Parser;
use common::scene::ExampleSceneController;
use env_logger;
use inox2d::formats::inp::parse_inp;
use inox2d::math::camera::Camera;
use inox2d::render::InoxRendererExt;
use inox2d_wgpu::WgpuRenderer;
use log::*;
use pollster::block_on;
use winit::event::{Event, WindowEvent};
use winit::event_loop::{ControlFlow, EventLoop};
use winit::window::WindowBuilder;

use std::error::Error;
use std::fs;
use std::path::PathBuf;
use std::sync::Arc;

#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Cli {
#[arg(help = "Path to the .inp or .inx file.")]
inp_path: PathBuf,
}

fn main() -> Result<(), Box<dyn Error>> {
let cli = Cli::parse();

env_logger::init();

let event_loop = EventLoop::new()?;

info!("Loading {:?}", cli.inp_path);

let data = fs::read(cli.inp_path)?;
let mut model = parse_inp(data.as_slice())?;

info!(
"Successfully parsed puppet: {}",
(model.puppet.meta.name.as_deref()).unwrap_or("<no puppet name specified in file>")
);

model.puppet.init_transforms();
model.puppet.init_rendering();
model.puppet.init_params();
model.puppet.init_physics();

model.puppet.begin_frame();
model.puppet.end_frame(0.01);

let window = Arc::new(WindowBuilder::new().build(&event_loop).expect("valid window"));
let mut renderer = block_on(WgpuRenderer::new(window.clone(), &model)).expect("valid renderer");
let mut scene_controller = ExampleSceneController::new(&Camera::default(), 0.5);
let camera = Camera::default();

event_loop.set_control_flow(ControlFlow::Poll);
event_loop.run(|event, event_loop| {
match event {
Event::WindowEvent {
event: WindowEvent::Resized(new_size),
..
} => {
if let Err(err) = renderer.resize(new_size.width, new_size.height) {
error!("Resize failed: {}", err);
}
}
Event::WindowEvent {
event: WindowEvent::CloseRequested,
..
} => {
event_loop.exit();
}
Event::WindowEvent {
event: WindowEvent::RedrawRequested,
..
} => {
if let Err(err) = renderer.draw(&model.puppet) {
error!("Draw failed: {}", err);
}
}
Event::WindowEvent { event, .. } => {
scene_controller.interact(&event, &camera);
}
Event::AboutToWait => {
window.request_redraw();

//TODO: Swapchain? Swapchain.
}
_ => {}
}
})?;

Ok(())
}
Loading
Loading