Skip to content
/ vixen Public

Game engine written in C# with Vulkan (only) support. Do not use, needs rewrite...

License

Notifications You must be signed in to change notification settings

Rikarin/vixen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vixen

Freely available open source game engine designed in the similar way as Unity and based on Stride. The whole codebase is licensed under MIT license.

Motivation

Create game engine with requirements:

  • Support most popular platforms: Win64, OSX64, OSX-ARM, Linux64, Android/iOS
  • Run on .NET 8
  • Use Vulkan, OpenGL API
  • Custom shader language compiled to SPIR-V

Features

  • Entity Component System (Arch)
  • Serialization & InputSystem is based on the Stride Engine (fe4aa87cdac41ca7ec45cd26660fd5d8c9632944)

Used libraries

References

Topics (TODO)

  • Consider replacing UI.State with Signal implementation

  • Explicitly use RootNamespace

  • Generic interface for wrapping Vulkan & OpenGL

  • Rendering Pipelines

  • Addressable (bundling)

  • 2D/3D Physics (Jolt)

  • Shader compilation system

    • Reword to use Irony
  • PBR/BSDF shader program

  • VFX

  • Canvas component which renders ImGui into separate framebuffer

  • Camera

  • Lights

  • Image resize/optimization library

  • Model loading (Assimp)

  • Sound/Audio

  • Material

  • Mesh, MeshFilter, MeshRenderer

  • Textures

  • Support most common image formats as imports

  • Animation

  • Networking

  • Create wrappers around the ImageSharp library and others as well

  • Prefabs & Prefab Variants (format, serialize/deserialize)

  • Script/AsyncScript (EC way to script object instead of using systems)

  • Terrain

  • Scene

  • Create special method to be called after deserialization of an object

  • Metadata and some sort of FileId and VFS to resolve files by ID instead of their real location

  • Importers for importing .meta files and creating "Editor" objects

  • Build pipeline for exporting assets, bundling them, compressing by LZ4 or other format and creating a whole executable

  • Custom serialization library which can handle self referencing files by replacing references by {FileId:...} "structs"

  • Create some interfaces to make it possible to switch between OpenGL, WEbGL and Vulkan API

  • CI/CD builds (also release nightly build)

  • Generate API documentation

  • Load prefabs as entities in special EditorWorld ECS and then copy them to scene if used. Should this be done also for instantiating GameObjects at runtime?

  • Editor

    • Linking of assets. We should be able to link Mesh to MeshFilter class which should be represented as special reference in the editor (.meta files) but it's a regular object instance in C#
  • AssetImporter base class extended for Editor and Runtime

  • Editor one will use *Importers

  • Runtime one will import assets from bundles

  • Game build system

  • Pie menu in Editor when pressing space

  • 3D cursor for adding new objects in editor

  • GamePad/GameController input

  • Load multiple mice/keyboards

Architecture

Application is split into three main parts. Core, Editor and Platform. Editor is not bundled to game instance during the build.

Core

User API for interactions with the engine.

Platform

Provides Internal interfaces to Core and Editor for interacting with low level stuff such as OpenGL, GLFW or ImGui (for Editor only?).

Editor

Editor implements loading/saving of projects, compiling shaders (HLSL) with ShaderC to SPIR-V.

Topics

How MeshRenderer assigns materials to submeshes of a mesh?

How are meshes and submeshes loaded and stored? Should they be loaded right into the VertexBuffer and IndexBuffer and removed from the memory?

How UV mapping work?

How to instantiate GameObject into the Scene?

How to load whole project with assets, scenes and wire it up in the Editor?

Shaders - Loading, Compilation, Execution, Bundling

ShaderImporter --(ShaderCompiler)-> Shader

ShaderImporter (Editor only) should be triggered each time *.shader file is changed.

It passes shader file down to shader compiler and creates/updates Shader object cache file for spirv and reflections (single file, messagepack?)

During build, shaders are rebuilt with release configuration and packed according to asset pack configuration

During runtime initialization shaders are loaded from compiled spirv+reflection data file

Caching:

  • cache directory: $PROJECT/Cache/Shaders/<SHADER_NAME>-<SHADER_METADATA_ID>/<SHADER_FILE_HASH>.bin

Questions

  • When and how to load metadata files?
  • Should they be deserialized info ShaderImporter class?
  • Or create default metadata serializable POCO class?

About

Game engine written in C# with Vulkan (only) support. Do not use, needs rewrite...

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages