#engine #game #kaige #game-engine #2d-3d #3d-rendering #rust

bin+lib kaige_renderer

2D and 3D renderer made for KaiGE, but is usable in other cases

1 unstable release

0.0.1 Dec 12, 2023

#40 in #3d-rendering


Used in kaige

Custom license

53KB
464 lines

kaige_renderer

Checklist

  1. Learn wgpu Basics:

    • Understand wgpu concepts, such as devices, queues, and command buffers.
    • Familiarize yourself with wgpu's pipeline architecture.
  2. Set Up wgpu:

    • Use the wgpu crate to access the wgpu API.
    • Set up a wgpu instance and adapter.
  3. Window Integration:

    • Integrate wgpu with a windowing system (e.g., winit) to handle window creation and input.
  4. Surface and Swap Chain:

    • Create a surface from the window.
    • Set up a swap chain for presenting images to the screen.
  5. Create Graphics Pipeline:

    • Define the shader stages (vertex, fragment, etc.).
    • Specify the vertex input format.
    • Configure rasterization settings.
    • Set up depth and stencil testing.
  6. Buffers and Memory Management:

    • Create vertex and index buffers for 3D rendering.
    • Manage uniform buffers for shaders.
    • Handle memory allocation and synchronization.
  7. Texture Loading:

    • Load and manage textures for both 2D and 3D rendering.
  8. Implement 2D Rendering:

    • Develop a sprite rendering system.
    • Support transformations (translation, rotation, scaling).
    • Handle layering and blending for 2D elements.
  9. Implement 3D Rendering:

    • Build a 3D model loading system.
    • Implement a camera system for 3D scenes.
    • Integrate lighting and shading techniques.
  10. Optimization:

    • Implement frustum culling for 3D objects.
    • Explore wgpu's multithreading capabilities for parallel processing.
  11. Error Handling and Validation:

    • Implement robust error handling and validation checks.
    • Utilize wgpu validation layers during development.

Resources

  1. wgpu Documentation:

  2. Tutorials and Examples:

  3. Books:

    • "WebGPU Programming Guide" by David Rousset
  4. GitHub Repositories:

  5. Community and Forums:

Dependencies

~21–61MB
~766K SLoC