Giter Site home page Giter Site logo

yangfengzzz / arche-webgpu Goto Github PK

View Code? Open in Web Editor NEW
57.0 3.0 8.0 5.25 MB

Entity-Component Based Graphics Engine rendered by WebGPU(Dawn)

Home Page: https://arche.graphics/zh-hans/docs/intro/

License: MIT License

C++ 85.72% C 12.37% CMake 1.19% Objective-C++ 0.15% Batchfile 0.03% Shell 0.03% GLSL 0.50%
computer-graphics webgpu dawn glsl-shaders spirv-cross wgsl-shader

arche-webgpu's Introduction

Arche-cpp - WebGPU Graphics Engine

This repository is about the implementation of Native WebGPU (Dawn) Engine. The goal of this project is not a general-purpose game engine, but to demonstrate engine technologies and tools that provide cross-platform based on WebGPU. Therefore, the development of the project is aimed at flattening and avoiding excessive encapsulation. You can refer to the internal technical implementation and apply it to your own project. For more thoughts on the project, visit the project blog.

Motivation

This project is very similar to Unity's component entity pattern (not ECS). Based on entity and component, it is easy to combine other open-source ability:

  1. ImGui: GUI system
  2. OZZ-Animation: Animation system
  3. JoltPhysics: Physics system

The asset pipeline is based on ozz-animation and assimp:

  1. All skeletal animation should use asset pipeline to generate OZZ files, which will compress raw-animation data and make runtime more efficiently. Now the skin only support FBX format, we will support GLTF convert in the future.
  2. All static model is loaded by using assimp which support a lot of data format and include geometry preprocessor.

Cloning && Install

This repository contains submodules for external dependencies, so when doing a fresh clone you need to clone recursively:

git clone --recursive https://github.com/ArcheGraphics/Arche-cpp.git

Existing repositories can be updated manually:

git submodule init
git submodule update

Because this project uses the SPIRV toolchain to compile shaders and implement shader reflections, and the KTX texture format requires Vulkan support, be sure to install the Vulkan toolchain (even on a Mac). At the same time, since the interface for reading SPIRV by Tint requires Vulkan support, you need to open the switch on CMakeLists.txt of dawn before compiling Tint, and install depot_tools at the same time.

cd third_party/dawn && vim CMakeLists.txt
set(ENABLE_VULKAN ON)

After all those work, use the script in third_party folder to build them all:

./build.sh

I recommend use Clion as main IDE(which can load cmake directly), but I also add xcode project which can capture metal frame when debug graphics feature.

Feature

You can read code in apps to find the feature in this code, like physics and shadow(WIP):

PhysX

You can also redirect to repos to see more effects.

arche-webgpu's People

Contributors

yangfengzzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

arche-webgpu's Issues

Running on Windows 10

I am using Visual Studio 2022
I have to make some modifications to few CMakeLists.txt files to get compiled successfully. But still have issues.
Can you please elaborate instructions to get it working on Windows with Visual Studio 2022 community version?
Thank you in advance.

Can not run apps

Xcode console output:

2022-04-06 16:59:32.442991+0800 apps[27964:1382135] Metal GPU Frame Capture Enabled
2022-04-06 16:59:32.443333+0800 apps[27964:1382135] Metal API Validation Enabled
E20220406 16:59:32.921794 1382135 graphics_application.cpp:84] Validation error: stencilLoadOp (LoadOp::Load) must not be set if the attachment ([TextureView]) has no stencil aspect or stencilReadOnly (0) is true.
 - While validating depthStencilAttachment.
 - While encoding [CommandEncoder].BeginRenderPass([RenderPassDescriptor]).
E20220406 16:59:32.922536 1382135 graphics_application.cpp:84] Validation error: [Invalid CommandBuffer] is invalid.
    at ValidateObject (/Users/apple/Documents/Github/Arche-cpp/third_party/dawn/src/dawn/native/Device.cpp:573)
    at ValidateSubmit (/Users/apple/Documents/Github/Arche-cpp/third_party/dawn/src/dawn/native/Queue.cpp:396)
E20220406 16:59:32.939886 1382135 graphics_application.cpp:84] Validation error: stencilLoadOp (LoadOp::Load) must not be set if the attachment ([TextureView]) has no stencil aspect or stencilReadOnly (0) is true.
 - While validating depthStencilAttachment.
 - While encoding [CommandEncoder].BeginRenderPass([RenderPassDescriptor]).
E20220406 16:59:32.940028 1382135 graphics_application.cpp:84] Validation error: [Invalid CommandBuffer] is invalid.
    at ValidateObject (/Users/apple/Documents/Github/Arche-cpp/third_party/dawn/src/dawn/native/Device.cpp:573)
    at ValidateSubmit (/Users/apple/Documents/Github/Arche-cpp/third_party/dawn/src/dawn/native/Queue.cpp:396)
E20220406 16:59:33.033268 1382135 graphics_application.cpp:84] Validation error: stencilLoadOp (LoadOp::Load) must not be set if the attachment ([TextureView]) has no stencil aspect or stencilReadOnly (0) is true.
 - While validating depthStencilAttachment.
 - While encoding [CommandEncoder].BeginRenderPass([RenderPassDescriptor]).
E20220406 16:59:33.033375 1382135 graphics_application.cpp:84] Validation error: [Invalid CommandBuffer] is invalid.
    at ValidateObject (/Users/apple/Documents/Github/Arche-cpp/third_party/dawn/src/dawn/native/Device.cpp:573)
    at ValidateSubmit (/Users/apple/Documents/Github/Arche-cpp/third_party/dawn/src/dawn/native/Queue.cpp:396)
E20220406 16:59:33.051265 1382135 graphics_application.cpp:84] Validation error: stencilLoadOp (LoadOp::Load) must not be set if the attachment ([TextureView]) has no stencil aspect or stencilReadOnly (0) is true.

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.