Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rainbow Triangle

A high-performance graphics demonstration written in Rust using the wgpu library. This project showcases a modern rendering pipeline setup, including vertex/fragment shaders and uniform buffer manipulation for real-time transformations.

Features

  • WGPU Rendering: Utilizes the WebGPU API for cross-platform, low-level graphics access.
  • Real-time Transformations:
    • Rotation: Rotates the geometry around the Z-axis.
    • Scaling: Pulses the size of the triangle dynamically.
    • Wobble: Applies a time-based distortion effect via uniforms.
  • Shader Pipeline: Custom WGSL shaders for vertex and fragment processing.
  • Uniform Buffers: Efficient CPU-to-GPU data transfer for transformation matrices and time variables.

Prerequisites

  • Rust (latest stable toolchain)
  • A graphics driver with Vulkan, Metal, DX12, or GLES3 support.

Getting Started

  1. Clone the repository:

    git clone https://github.com/your-username/rainbow_triangle.git
    cd rainbow_triangle
  2. Run the application:

    cargo run

    Note: Check cargo run -- --help to see available command-line flags for enabling rotation, scaling, or wobble effects.

Tech Stack

  • wgpu: Safe and portable GPU abstraction.
  • winit: Window creation and event handling.
  • glam: Fast linear algebra for rendering math.
  • bytemuck: Zero-cost casting for buffer data.
  • clap: Command-line argument parsing.

About

Rust Rainbow Triangle with WebGPU

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages