Giter Site home page Giter Site logo

wgpu-step-by-step's Introduction

wgpu Graphics Programming in Rust: Step-by-Step

$$\textcolor{red}{\text{Good news: all code examples have been updated from wgpu 0.13.1 to 0.17.}}$$

wgpu is based on the WebGPU standard. It is a cross-platform, safe, pure Rust graphics API that runs natively on Vulkan, Metal, DirectX 12, DirectX 11, and OpenGLES, as well as on the web via WebAssembly. I have created a YouTube video series about wgpu programming in Rust, presenting an easy-to-follow wgpu application in each video episode. This repository contains all the code examples used in this video series.

In this YouTube video series, I use real-world sample apps to explain the basics of wgpu, including shader programs, GPU buffers, and rendering pipelines. Throughout the series, you will learn how to create primitives and simple objects in Rust with wgpu. As you progress, you will delve into advanced wgpu topics, such as 3D transformations, lighting calculations, colormaps, and textures. Simultaneously, you will discover how to create advanced 3D wgpu objects, including various 3D wireframes, 3D shapes, simple and parametric 3D surfaces with colormaps and textures, and 3D surface plots. Additionally, you will explore new wgpu features, such as compute shaders and storage buffers, and learn how to use them to 3D graphics.

By the end of this video series, you will have the solid skills you need to build your own GPU-accelerated graphics and computing applications on native devices and the web using the wgpu API in Rust.


Books on Rust wgpu, wgpu-py, and WebGPU

Most of the examples used in this video series are taken from my recently published book "Practical GPU Graphics with wgpu and Rust".

I just published a new book of the Python version of WebGPU: "Practical GPU Graphics with wgpu-py and Python".

I also published a new book "Practical WeGPU Graphics".

wgpu Rust Book    wgpu-py Book    WebGPU Book

Please see details about these books at https://drxudotnet.com.


YouTube Video Links:

Please visit my YouTube channel: Practical Programming with Dr. Xu

Video Series for Rust wgpu Step-by-Step:

  1. Introduction to wgpu: https://youtu.be/i6WMfY-XTZE
  2. Set up Development Environment: https://youtu.be/LULQtc5CUJ8
  3. Create a Colorful Triangle: https://youtu.be/hOojFOho_lI
  4. Create Point and Line Primitives: https://youtu.be/-QXj0UexUw0
  5. Create Triangle Primitives: https://youtu.be/TFVjMmSRDxs
  6. Create a Square using GPU Buffer: https://youtu.be/GIEjzG2wwJY
  7. Create a 3D Cube: https://youtu.be/ai53VFoqdJQ
  8. Animate a 3D Cube: https://youtu.be/9SsjhrxH08o
  9. Light Model: https://youtu.be/YF6VepGkUJs
  10. Cube with Lighting: https://youtu.be/mPbsgFYb2z8
  11. Sphere with Lighting: https://youtu.be/2bW_uCOKiKc
  12. Torus with Lighting: https://youtu.be/CC3stU82iZg
  13. Colormap: https://youtu.be/D0wrVy7lAcg
  14. 3D Simple Surfaces: https://youtu.be/XfVeMrumi7o
  15. 3D Sinc Surface: https://youtu.be/O7xIQudPKmA
  16. 3D Peaks Surface: https://youtu.be/6d5l2huTm9E
  17. Parametric 3D Surfaces: https://youtu.be/ODLGjzR9mWY
  18. Parametric 3D Surface Examples: https://youtu.be/AjDU7eegt4g

Sample Objects

Here are some sample objects created using the wgpu API, which I will discussed in my video series.

Klein Bottle and Wellenkugel Surface:

klein-bottle        wellenkugel

Snail Shell and Sievert-Enneper Surface:

snail-shell     sievert-enneper

Breather Surface and 3D Sinc Surface:

breather     sinc

Multiple-Textures:

textures


License

The MIT License (MIT).

Copyright (c) 2022 Jack Xu.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

wgpu-step-by-step's People

Contributors

jack1232 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.