Skip to content

Commit

Permalink
Fix quad & remove post processing from lib due to redundancy
Browse files Browse the repository at this point in the history
  • Loading branch information
hakolao committed Sep 14, 2023
1 parent b8c1681 commit 79b7111
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ pub trait GlassApp {
fn update(&mut self, _context: &mut GlassContext) {}
/// Run each frame for each window after update
fn render(&mut self, _context: &GlassContext, _render_data: RenderData) {}
/// Run each frame for each window after rendering per window
fn post_processing(&mut self, _context: &GlassContext, _render_data: RenderData) {}
/// Run each frame for each window after post processing
fn after_render(&mut self, _context: &GlassContext) {}
/// Run each frame last
Expand Down
2 changes: 1 addition & 1 deletion examples/fluid_sim/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ impl GlassApp for FluidSimApp {
&mut rpass,
&render_target_bind_group,
// Center
[0.0, 0.0, 0.0, 1.0],
[0.0, 0.0, 0.0, 0.0],
camera.centered_projection().to_cols_array_2d(),
window_size_f32,
1.0,
Expand Down
7 changes: 1 addition & 6 deletions src/glass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,12 @@ impl<A: GlassApp + 'static> Glass<A> {
label: Some("Render Commands"),
});

// Run render & post processing functions
// Run render
self.app.render(&context, RenderData {
encoder: &mut encoder,
window,
frame: &frame,
});
self.app.post_processing(&context, RenderData {
encoder: &mut encoder,
window,
frame: &frame,
});

context
.device_context
Expand Down
3 changes: 1 addition & 2 deletions src/glass_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ pub trait GlassApp {
});
}
}
/// Run each frame for each window after rendering per window
fn post_processing(&mut self, _context: &GlassContext, _render_data: RenderData) {}

/// Run each frame for each window after post processing
fn after_render(&mut self, _context: &GlassContext) {}
/// Run each frame last
Expand Down
2 changes: 1 addition & 1 deletion src/pipelines/quad/quad.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn vs_main(
) -> VertexOutput {
var out: VertexOutput;
out.tex_coords = model.tex_coords;
let world_position = vec4<f32>(pc.dims, 0.0, 0.0) *
let world_position = vec4<f32>(pc.dims, 0.0, 1.0) *
// Scale vertices
model.position +
// Offset by pos
Expand Down

0 comments on commit 79b7111

Please sign in to comment.