Hotham is a framework for quickly and easily creating amazing standalone VR experiences.

Overview

Hotham Logo

🚧 Under construction! Please mind the mess! 🚧

Introduction

G'day, and welcome to Hotham! πŸ‘‹

Hotham is an attempt to create a lightweight, high performance game engine for mobile VR headsets. It's primarily aimed at small (1-5 person) teams of mostly technical folk who are looking to create games for devices like the Oculus Quest, but find existing tools cumbersome to work with.

If you're looking for a more general purpose engine to create games in Rust, make sure you check out Bevy Engine! If, however, you're looking for a way to make VR development less painful, Hotham will be available to developers in late 2021.

For a full list of what's going to be available, checkout the 0.1 issue. Your feedback is very very welcome!

Sponsoring

Hotham's development is only possible thanks to the support of the community. It's currently being developed on full time by @kanerogers If you'd like to help make VR development in Rust possible, please consider becoming a donor. πŸ’—

Progress πŸ”¨

  • Vulkan renderer
  • OpenXR integration
  • Android (eg. Oculus Quest) support
  • Simple Windows-based OpenXR simulator
  • Import of glTF models
  • Simple lighting and shading model
  • Support for skinned models
  • Support for animations
  • Hand/controller presence
  • Grabbing support
  • Basic physics (eg. collision detection) support
  • Basic PBR support
  • Simple debug UI
  • Sound support
  • Text/UI support

Beat Saber

Future goals ✨

  • Visual editor
  • Fast reloading
  • OpenXR record/playback for integration testing
  • Better debugging support
  • Better performance profiling support
Comments
  • Verify builds on other machines

    Verify builds on other machines

    Description

    In order for other people to use hotham, they're going to need to build it on their machine!

    TODO

    • [x] Verify clean build on Windows
    • [x] Verify clean build on Linux
    • [x] Verify clean build on macOS
    maintenance 
    opened by kanerogers 25
  • Implement Clippy

    Implement Clippy

    Description

    Clippy will probably get mad.

    TODO

    • [X] Incorporate Clippy
    • [X] Too Many Arguments problems
    • [X] Non Send Fields in Send Type problem
    • [X] Type Complexity Problems
    • [X] Remove commented references to Clippy in code

    Problems

    Clippy: Too Many Arguments

    1. panel.rs add_panel_to_world (10/7)
      --> hotham/src/components/panel.rs:79:1                                                                                                                                                                       
       |                                                                                                                                                                                                            
    79 | / pub fn add_panel_to_world(                                                                                                                                                                               
    80 | |     text: &str,                                                                                                                                                                                          
    81 | |     width: u32,                                                                                                                                                                                          
    82 | |     height: u32,                                                                                                                                                                                         
    ...  |                                                                                                                                                                                                          
    89 | |     world: &mut World,                                                                                                                                                                                   
    90 | | ) -> Entity {                                                                                                                                                                                            
       | |___________^                                                                                                                                                                                              
       |                                                                                                                                                                                                            
    
    1. gltf_loader.rs load_node (8/7)
      --> hotham/src/gltf_loader.rs:88:1                                                                                                                                                                            
       |                                                                                                                                                                                                            
    88 | / fn load_node(                                                                                                                                                                                            
    89 | |     node_data: &gltf::Node,                                                                                                                                                                              
    90 | |     gltf_buffer: &[u8],                                                                                                                                                                                  
    91 | |     vulkan_context: &VulkanContext,                                                                                                                                                                      
    ...  |                                                                                                                                                                                                          
    96 | |     images: &[gltf::image::Data],                                                                                                                                                                        
    97 | | ) -> Result<()> {                                                                                                                                                                                        
       | |_______________^                                                                                                                                                                                          
       |                                                                                                                                                                                                            
    
    1. image.rs new (8/7)
    warning: this function has too many arguments (8/7)                                                                                                                                                             
      --> hotham/src/image.rs:17:5                                                                                                                                                                                  
       |                                                                                                                                                                                                            
    17 | /     pub fn new(                                                                                                                                                                                          
    18 | |         handle: vk::Image,                                                                                                                                                                               
    19 | |         view: vk::ImageView,                                                                                                                                                                             
    20 | |         device_memory: vk::DeviceMemory,                                                                                                                                                                 
    ...  |                                                                                                                                                                                                          
    25 | |         layer_count: u32,                                                                                                                                                                                
    26 | |     ) -> Self {                                                                                                                                                                                          
       | |_____________^                                                                                                                                                                                            
       |                                                                                                                                                                                                            
    
    1. vulkan_context.rs create_texture_image (9/7)
       --> hotham/src/resources/vulkan_context.rs:467:5                                                                                                                                                          
        |                                                                                                                                                                                                           
    467 | /     pub fn create_texture_image(                                                                                                                                                                        
    468 | |         &self,                                                                                                                                                                                          
    469 | |         name: &str,                                                                                                                                                                                     
    470 | |         image_buf: &[u8], // Clippy &Vec<u8>, ptr_arg for texture.rs                                                                                                                                    
    ...   |                                                                                                                                                                                                         
    476 | |         offsets: Vec<vk::DeviceSize>,
    477 | |     ) -> Result<(Image, vk::Sampler)> {
        | |_____________________________________^
        |
    
    1. vulkan_context.rs create_textures_descriptor_sets (8/7)
       --> hotham/src/resources/vulkan_context.rs:802:5
        |
    802 | /     pub fn create_textures_descriptor_sets(
    803 | |         &self,
    804 | |         set_layout: vk::DescriptorSetLayout,
    805 | |         material_name: &str,
    ...   |
    810 | |         emissive_map: &Texture,
    811 | |     ) -> VkResult<Vec<vk::DescriptorSet>> {
        | |_________________________________________^
    

    Clippy: Type Complexity

    warning: very complex type used. Consider factoring parts into type definitions

    1. texture.rs
       --> hotham/src/texture.rs:183:6
        |
    183 | ) -> Result<(Vec<u8>, u32, u32, vk::Format, u32, u32, Vec<vk::DeviceSize>)> {
        |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
    
    1. vertex.rs
      --> hotham/src/vertex.rs:35:12
       |
    35 |           t: (
       |  ____________^
    36 | |             Vector3<f32>,
    37 | |             Vector3<f32>,
    38 | |             Vector2<f32>,
    ...  |
    41 | |             Vector4<f32>,
    42 | |         ),
       | |_________^
       |
    
    1. mod.rs
      --> examples/crab-saber/src/systems/mod.rs:15:9
       |
    15 |         PreparedQuery<With<Visible, With<Cube, (&'a Colour, &'a RigidBody, &'a Collider)>>>,
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
    

    Clippy: Non Send Fields in Send Type

    1. audio_context.rs impl Send for AudioContext
    warning: this implementation is unsound, as some fields in `AudioContext` are `!Send`                                                                                                                           
      --> hotham/src/resources/audio_context.rs:97:1                                                                                                                                                                
       |                                                                                                                                                                                                            
    97 | unsafe impl Send for AudioContext {}                                                                                                                                                                       
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                       
       |                                                                                                                                                                                                            
       = note: `#[warn(clippy::non_send_fields_in_send_ty)]` on by default                                                                                                                                          
    note: the type of field `stream` is `!Send`                                                                                                                                                                     
      --> hotham/src/resources/audio_context.rs:22:5                                                                                                                                                                
       |                                                                                                                                                                                                            
    22 |     pub stream: Arc<Mutex<Stream>>,                                                                                                                                                                        
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                         
       = help: use a thread-safe type that implements `Send`                                                                                                                                                        
    
    cleanup maintenance 
    opened by kanerogers 22
  • "Good enough" glTF PBR support

    Background

    Currently things in hotham look terrible. Let's fix that!

    Research

    TODO

    • [x] Write an integration test for rendering_system that takes a path to a gltf file and outputs the render to a file
    • [x] Import @SaschaWillems PBR shaders

    RenderContext

    • [x] Update descriptor sets
      • [x] Update SceneSet
      • [x] Update MeshSet
      • [x] Add MaterialSet
    • [x] Add Material struct
    • [x] Update PushConsts
    • [x] Update Pipeline
    • [x] Add SceneParams
    • [x] Update scene UBO -> can we stick with push constants for vertex shader?
    • [x] Investigate handling of non-skinned entities

    Mesh

    • [x] Add Vec<Primitive>
    • [x] Push VertexBuffer and IndexBuffer into Primitive
    • [x] Add Material to Primitive
    • [x] Add all material bindings
    • [x] Add texture_descriptor_set to Primitive

    renderer_system

    • [x] Bind to correct descriptor sets
    • [x] Multiview

    gltf_importer

    • [x] Update Vertex
    • [x] Import correct Vertex attributes
    • [x] Import correct images
    • [x] Create Material

    Test models

    rendering 
    opened by kanerogers 17
  • Beat Saber example

    Beat Saber example

    Description

    One of the most important things when releasing complex software is providing examples. Not only does it provide users with a transparent way to see "how" to do things with the software, it gives users confidence in "what" can be done with the software.

    Since Hotham is first and foremost a VR game engine, we need to prove that we can make VR games with it. What better game to make than Beat Saber?

    This will require careful planning - it'd be very easy to get derailed and stuck in the weeds here. Beat Saber is a big and complex game, but there should be a way to cut it down to its simplest elements and recreate them.

    TODO

    Research

    • [x] Play the game and break down all its elements systematically
    • [x] Look for other examples of people cloning the game - what did they leave in, what did they out?

    Assets

    • [x] Create a "bill of materials" - what will need to be included in the game?
    • [x] Acquire/build assets

    Programming

    • [x] Sketch out a rough shape of what the code would look like
    • [x] Identify missing engine features
    • [x] #94
    • [x] Implement Saber System
    • [x] Implement Game System
    • [x] #105
    • [ ] Implement #93
    • [ ] Implement #52
    maintenance 
    opened by kanerogers 8
  • Add `Stage` component to allow manipulating the transform of the player's frame of reference

    Add `Stage` component to allow manipulating the transform of the player's frame of reference

    Makes the implementation of all kinds of locomotion a lot simpler - just transform the Room in space.

    Should work for teleportation as well as more granular kinds.

    Includes systems for correcting the views (update_views_with_room_transform) and for adding the Room entity & parenting Hands (add_room).

    Closes #295

    opened by ickk 7
  • [Renderer] GPU crash - IOCTL_KGSL_GPU_COMMAND

    [Renderer] GPU crash - IOCTL_KGSL_GPU_COMMAND

    Background

    Shared memory between CPU and GPU needs to be handled carefully:

    07-12 18:40:02.018 11598 11675 I VrApi   : FPS=62/72,Prd=40ms,Tear=0,Early=0,Stale=20,VSnc=0,Lat=-1,Fov=0,CPU4/GPU=2/3,1171/490MHz,OC=FF,TA=0/0/0,SP=N/N/N,Mem=1804MHz,Free=560MB,PLS=0,Temp=31.0C/0.0C,TW=1.05ms,App=13.52ms,GD=0.00ms,CPU&GPU=20.85ms,LCnt=1,GPU%=0.96,CPU%=0.07(W0.10),DSF=1.00
    07-12 18:40:02.069 11598 11624 I RustStdoutStderr: Adding Damaged Helmet to world
    07-12 18:40:02.069 11598 11624 I RustStdoutStderr: [HOTHAM_STRESS_TEST] There are now 237 models
    07-12 18:40:02.400 11598 11625 W Adreno-GSL: <gsl_ldd_control:556>: ioctl fd 56 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) failed: errno 71 Protocol error
    07-12 18:40:02.400 11598 11625 W Adreno-GSL: <log_gpu_snapshot:464>: panel.gpuSnapshotPath is not set.not generating user snapshot
    07-12 18:40:02.458 11598 11625 W Adreno-GSL: <gsl_ldd_control:556>: ioctl fd 56 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) failed: errno 35 Resource deadlock would occur
    07-12 18:40:02.458 11598 11625 W Adreno-GSL: <log_gpu_snapshot:464>: panel.gpuSnapshotPath is not set.not generating user snapshot
    
    bug rendering showstopper 
    opened by kanerogers 6
  • Refactor transformations

    Refactor transformations

    • Rename transforms to LocalTransform and GlobalTransform
    • Rename related systems.
    • ~~Add update_global_transforms_system that calls update_transform_matrix_system and update_parent_transform_matrix_system. This is because they don't make much sense to run separately.~~
    opened by rasmusgo 5
  • [Rendering] Fix frustum culling

    [Rendering] Fix frustum culling

    At present our frustum culling is both slow and incorrect.

    An optimisation was made by @kanerogers to create a virtual frustum incorporating both cameras, but this has not proven to be correct. In addition, the underlying isVisible function in the compute shader is extremely expensive, and should, if possible, be reduced to a plane intersection check.

    rendering 
    opened by kanerogers 5
  • [Bug] Hands animation no longer working

    [Bug] Hands animation no longer working

    Background

    After the upgrade of the glTF importer and the new rendering backend, the hands animation is no longer working. This is somewhat understandable as the way hands were being animated was a big hack.

    glTF animation is well defined, but for some reason when exporting the default Oculus hands from Unity, the animations are completely mangled: instead of giving us keyframes between two states (hand open and hand closed) we get two animations, each with a single keyframe. We work around this by just creating a single animation and use each state (open and closed) as a keyframe.

    TODO

    • [ ] Should we just get better models with correct animations?
    opened by kanerogers 5
  • Applying smoother movement to the camera in the simulator

    Applying smoother movement to the camera in the simulator

    Changes:

    • added a struct to store inputs over frames, so we can apply multiple directional movement to the camera
    • added last_frame_time to the state so I can smooth the camera movement

    Possible Todo's:

    • Move camera in rotation direction, for full 3D movement, maybe something similar to unity?
    • Might be worth adding test but probably not that much value?
    opened by louisgjohnson 5
  • CI Improvements

    CI Improvements

    Description

    Our CI is good, but it could be better.

    The complex thing here is #164, which we'll handle in a separate issue.

    TODO

    • [x] Add caching
    • [ ] Add clippy
    • [ ] Separate test from check
    maintenance 
    opened by kanerogers 5
  • Push constants for materials

    Push constants for materials

    This is a subset of the krperf branch with several fixes added to fix stuff that was broken. There is at least one problem remaining: The desktop version of the helmet model has ambient occlusion stored in a separate texture but the support for that is dropped. This breaks the pbr rendering test.

    This follows #413 and replaces #411.

    Before merging:

    • [ ] Update helmet model to fix ambient occlusion on desktop.
    • [ ] Ensure render tests pass, updating images as needed.
    opened by rasmusgo 0
  • [Bug]: Simulator error `ERROR_OUT_OF_DATE_KHR`

    [Bug]: Simulator error `ERROR_OUT_OF_DATE_KHR`

    What happened?

    Attempting to run the device simulator on my linux setup fails every time. My setup is as follows:

    OS: Ubuntu 22.04.1
    Kernel: 5.15.0-56-generic
    WM: i3
    Compositor: picom
    CPU: 13th Gen Intel i7-13700KF (24) @ 5.300GHz
    GPU: NVIDIA GeForce RTX 3070 Ti
    Memory: 2370MiB / 31913MiB
    

    I am using the master branch of hotham, whose Cargo.toml files state a version of 0.2.0.

    When running the hotham_crab_saber bin, in release mode, the window is created but closes before the first frame renders. The error printed is below.

    Version

    latest

    In which Hotham component are you seeing the problem on?

    Simulator

    What VR System are you seeing the problem on?

    None

    What OS are you seeing the problem on?

    Linux

    Relevant log output

    [HOTHAM_POLL_EVENT] State is now IDLE
    [HOTHAM_POLL_EVENT] State is now READY
    [HOTHAM_SIMULATOR] Beginning session: Session(42)
    [HOTHAM_POLL_EVENT] State is now SYNCHRONIZED
    [HOTHAM_POLL_EVENT] State is now FOCUSED
    [HOTHAM_DRAW_GUI] Updating font texture..
    [HOTHAM_VULKAN] Creating staging buffer..
    [HOTHAM_VULKAN] Allocated 2097152 bits of buffer memory: 0x5626e5065dd0
    [HOTHAM_VULKAN] ..done!
    [HOTHAM_VULKAN] Copying buffer to image..
    [HOTHAM_VULKAN] ..done! Transitioning image layout..
    [HOTHAM_VULKAN] ..done! Freeing staging buffer..
    [HOTHAM_VULKAN] ..done!
    [HOTHAM_DRAW_GUI] Done!
    [HOTHAM_SIMULATOR] !ERROR RENDERING FRAME! ERROR_OUT_OF_DATE_KHR
    [HOTHAM_SIMULATOR] Destroy called..
    [HOTHAM_SIMULATOR] Closed called!
    [HOTHAM_SIMULATOR] Closed called!
    [HOTHAM_SIMULATOR] Closed called!
    [HOTHAM_SIMULATOR] All things are now destroyed
    Error: OpenXRError(ERROR_VALIDATION_FAILURE)
    
    bug 
    opened by campbellcole 0
  • De-duplicate pbr.frag by using global variables

    De-duplicate pbr.frag by using global variables

    When I tried de-duplicating this code by passing more parameters, it showed clearly in the many helmets stress test. This time, there is no significant difference! See dedup.txt vs main.txt.

    I have also run test_rendering_pbr and it passes with no changes in the images.

    opened by rasmusgo 0
  • Use float16 in fragment shader

    Use float16 in fragment shader

    ~Almost working as it should. There is a problem with specular highlight that I am trying to pin down at the moment.~

    ~I also made a convenience thing for updating the pbr rendering tests if UPDATE_IMAGES env var is truthy. That might belong in a separate PR.~

    I have fixed several issues with the spotlights and I think this is starting to look good enough now. There is a difference with rendering reflections of spotlights on very shiny surfaces. The new code is more likely to show a reflection of the spotlight but it it flickers. This is visible in the normal tangents test scene but not on the helmet.

    I ran the many helmets benchmark but was surprised to see no difference in performance. Perhaps the bottleneck is somewhere else?

    opened by rasmusgo 2
Owner
Let Eyes Equals Two
Trying to make VR development slightly less painfulβ„’
Let Eyes Equals Two
Engine / framework for creating highly customizable and user modable action RPG's

Rust RPG Toolkit PLEASE NOTE: this in early and very heavy development. API is subject to constant change, as it has newly transitioned from being a g

Ole A. Sjo Fasting 58 Dec 5, 2022
Abstreet - Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit

A/B Street Ever been stuck in traffic on a bus, wondering why is there legal street parking instead of a dedicated bus lane? A/B Street is a project t

A/B Street 6.8k Jan 9, 2023
a prototype crate for creating modular and performant 3D CPU particle systems, inspired by Unity's Shuriken Particle System.

bevy_prototype_particles This is a prototype crate for creating modular and performant 3D CPU particle systems, inspired by Unity's Shuriken Particle

James Liu 28 Sep 12, 2022
A Bevy plugin to easily create and manage windows that remember where they were.

bevy-persistent-windows A Bevy plugin to easily create and manage windows that remember where they were. Background When you're developing a game, thu

Umut 4 Aug 12, 2023
NeosPeeps is tool that allows for listing your NeosVR friends quickly, without having to actually open the whole game

Neos Peeps NeosPeeps is tool that allows for listing your NeosVR friends quickly, without having to actually open the whole game. It also has a bunch

LJ 6 Sep 12, 2022
Template for jumpstarting production-ready Farcaster frames quickly

Rust Farcaster Frames Template Template for jumpstarting production-ready Farcaster frames quickly. β€” no fuss, all fun! Features Seamless Integration:

jpgonzalezra 13 Feb 21, 2024
Rust library to create a Good Game Easily

ggez What is this? ggez is a Rust library to create a Good Game Easily. The current version is 0.6.0-rc0. This is a RELEASE CANDIDATE version, which m

null 3.6k Jan 7, 2023
An attempt to create an easily customizable MMORPG game engine. Sky not included.

skyless Proof of concept of an easily customizable MMORPG game engine. Getting started Copy environment variables cp .env.example .env Start the engi

null 8 Nov 23, 2022
Bell is a work in progress programming language that compiles to MCfunction (Minecraft's language for creating datapacks).

Bell is a work in progress programming language that compiles to MCfunction (Minecraft's language for creating datapacks). It provides a higher level,

Yoav 17 Aug 25, 2022
Easily update your minecraft mods with 1 file (guess I'm back to rust again)

Mod Updater This program updates all your mods to a newer/later version. To use: Create a file named config.toml Create a folder named mods; Add the f

sussyimpostor 2 Sep 18, 2022
Creating a simple flappy bird game in Rust language

Creating a simple flappy bird game in Rust language The main goal of this project is to get my hands dirty with rust, while creating something fun. Ex

Sajidur Rahman 1 Feb 10, 2022
Utilities for creating strictly ordered execution graphs of systems for the Bevy game engine

bevy_system_graph This crate provides the utilities for creating strictly ordered execution graphs of systems for the Bevy game engine. Bevy Version S

Hourai Teahouse 19 Dec 2, 2022
Wein2D.js bindings for creating browser games in Rust using WebAssembly.

Wein2D.js-WASM Wein2D.js bindings for creating browser games in Rust using WebAssembly. Wein2D.js-WASM requires Wein2d.js to be loaded in the same doc

DevTaube 1 Apr 14, 2022
Facilitate the process of creating a decompilation project for a given Wii/Gamecube game

dadosod Facilitate the process of creating a decompilation project for a given Wii/Gamecube game Features Disassembly DOL Guess/Calculate common secti

Wesley Moret 7 Dec 7, 2022
A tool for creating optimised, platform specific glTF files.

Squisher What? squisher is a program that takes a glTF or .glb file with PNG/JPG textures and produces a .glb file where the textures have been replac

Let Eyes Equals Two 4 Aug 24, 2022
A Bevy helper to easily manage resources that need to persist across game sessions.

bevy-persistent A Bevy helper to easily manage resources that need to persist across game sessions. Background In games, there are a lot of resources

Umut 5 Mar 25, 2023
A bevy plugin for creating grids, for debugging purposes

Bevy Debug Grid A plugin for creating debug mesh grids in the bevy game engine. The default_cube example Installation To install this plugin, add the

BambeH 8 Apr 1, 2023
Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust

Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust Slow down, upon the teeth of Orange Heav

Shea Leffler 12 Mar 18, 2022
A small, portable and extensible game framework written in Rust.

What is This? Crayon is a small, portable and extensible game framework, which loosely inspired by some amazing blogs on bitsquid, molecular and flooo

JK Mao 174 Oct 22, 2022