Skip to main content

wgpu_render_manager/
lib.rs

1// lib.rs
2//! # wgpu_render_manager
3//!
4//! A helper crate for rendering and computing using `wgpu`, made specifically for game engines.
5//!
6//! It can:
7//! - Render textures to the screen for debugging and visualization purposes
8//! - Render anything using automatically procedurally generated textures
9//! - Procedurally generate textures using TextureKey and a shader
10//! - Make compute pipelines trivial using [`compute()`](compute_system::ComputeSystem::compute())
11//!
12//! This crate makes game development and rendering with fullscreen passes a breeze.
13//!
14//! ## Goals
15//! - Minimal boilerplate
16//! - Zero magic around bind groups
17//! - Easy fullscreen rendering of any texture
18//!
19//! ## Shader Binding layout
20//! - `@group(0) @binding(0)`: trilinear sampler
21//! - `@group(0) @binding(0..n)`: textures as texture_2d<f32> or texture_multisampled_2d<f32>
22//! - `@group(0) @binding(n+1)`: (optional) shadow_sampler
23//! - `@group(0) @binding(n+2)`: (optional) shadow textures as texture_depth_2d_array
24//! - `@group(1) @binding(0..n)`: uniforms, in the same order as input
25//!
26//! ## Basic usage
27//! ```no_run
28//! // Inside a render pass
29//! render_manager.render_with_textures(
30//!     &texture_views.as_slice(), // Texture Views
31//!     shader_path.as_path(),     // Shader Path
32//!     options,                   // PipelineOptions
33//!     &[&uniforms_buffer],       // Buffers
34//!     &mut render_pass,          // Render Pass
35//! );
36//! ```
37//!
38//! Used in my game [Rusty Skylines](https://github.com/maxwag9/rusty_skylines)
39
40pub mod compute_system;
41pub mod generator;
42pub mod pipelines;
43pub mod fullscreen;
44pub mod renderer;
45mod bind_groups;
46mod shader_preprocessing;