Bevy Vaporwave
- --
Github
--
Side project to learn the basics of wgsl and develop a look for my main Bevy project.
--
I'm learning. The code is pretty garbage. I doubt I will continue work on this, but I will roll what I learned into the main project and hopefully it will be better that time. If you're intetested though Have at it.
--
Features:
--
-
- Arbitrarily define edges to render, not render every triangle -
- Varying colors per mesh, no textures -
- Optionally "Solid" wireframe, ie it occludes its own back faces and objects behind it -
- Outline for silhouette when visible edges are sparse -
- Support gltf animation -
-
I developed a simple workflow with Blender which allows you to mark edges for rendering, paint vertex colors and store the data in a custom gltf attribute (see video below). It isn't great but it does the job. The blender files and a python script are in the repo. Bevy then builds a mesh out of line primitives for the wireframe and uses the original mesh for a fill. The mesh is duplicated, dilated along normals and pushed backwards in clip space by a shader to create the outline.
--
Issues:
--
-
- Wireframe thickness cannot be set because this is not supported by wgpu line primitives -
- Clip space method for outline isn't ideal, a stencil buffer approach would be better but I couldn't work out how to do that with wgpu / bevy render pipeline -
- Assets are post processed in a system triggered by SceneInstanceReady events. Something that ties into Bevy's async asset loading would be much better -
- The mesh building algorithm is very slow with large meshes -
-