An open API service indexing awesome lists of open source software.

https://github.com/btipling/rosy

A renderer
https://github.com/btipling/rosy

3d cplusplus game-development graphics vulkan

Last synced: about 1 year ago
JSON representation

A renderer

Awesome Lists containing this project

README

          

# Rosy

This is a hobby project to build a game engine and eventually a game in my spare time.

![Rosy and friends](https://github.com/user-attachments/assets/0e09dc48-a8da-47cd-8413-076e53ad0923)

![Sponza](https://github.com/user-attachments/assets/b324bc38-58ab-484e-bde1-7bbbd491a06f)

![A beautiful game](https://github.com/user-attachments/assets/f2f699e2-9690-4b93-83fd-6401dab71bf1)

## Modern Vulkan

This project uses modern Vulkan features including:

* Buffer device address
* Dynamic rendering
* Bindless
* Shader Objects
* One global descriptor set for all images and samplers

## Building

### Git submodules

Git submodules are used for some dependencies, they are not built automatically. They must be built with the same version of msbuild.

```txt
git submodule init
git submodule update
```

### Premake

This project uses [Premake](https://premake.github.io/) to build. Premake is required to build the project.

```txt
cd ./src
premake5 vs2022
```

On Windows this will generate a .sln file that can be opened in Visual Studio 2022.

The premake5.lua script serves as the most up to date documentation for what is required to build this project.

### Proprietary Dependencies

The project is open source, but it depends on non-free dependencies.

#### Vulkan SDK

The most recent version of the Vulkan SDK should be on the system. The Vulkan SDK can be downloaded from the [LunarG's Vulkan SDK website](https://www.lunarg.com/vulkan-sdk/).

#### FBX SDK

The most recent version of the FBX SDK should be on the system. The FBX SDK can be downloaded from the [Autodesk's FBX SDK website](https://aps.autodesk.com/developer/overview/fbx-sdk).

#### NVTT

Using the Packager program to create assets requires the NVIDIA Texture Tool library which defaults to CPU on non-NVIDIA hardware. The game itself uses this library to read DDS files and builds and should eventually be able to run fine on NVIDIA hardware I hope.
In order to use the Packager tool the `NVTT_PATH` env variable must be set to where the header files are and the shipped DLL must be in the same directory as Packager.exe. The
path is likely `C:\Program Files\NVIDIA Corporation\NVIDIA Texture Tools` on Windows. NVTT can be downloaded at the [NVIDIA Texture Tools 3 website](https://developer.nvidia.com/gpu-accelerated-texture-compression).

NVTT is used to compress and generate mipmaps for asset textures. It does so using a better API than libktx and uses available GPU hardware to compress images faster than libktx can. This makes a big difference when you are compressing many images as part of an asset pipeline. The compression speeds are multiple orders of magnitudes faster when using NVTT on an NVIDIA GPU. Every model ships with a slew of PBR textures, normal maps, albedo, metallic, etc and with libkts running on the CPU it can take tens of seconds to compress each large image. It adds up.

#### FastGLTF

```txt
cd .\libs\fastgltf\
cmake . -B build
```

Add fastgltf project to VS if it's not already there and build it

#### SDL

```txt
cd .\libs\SDL\
cmake . -B build
cmake --build build
```

#### flecs

```txt
cd .\libs\flecs\
cmake . -B out
cmake --build out
```

## Running

Windows requires the needed .dll files be in the same directory as the executable, this isn't done automatically.

Rosy has its own asset format. A glTF file can be converted to the .rsy format using Packager.exe, which is built when the solution is compiled.

Assuming there's an sponza.gltf on the system in an assets directory the packager can be run as so and it will add a sponza.rsy and generate *.dds images in the same directory as the sponza.gltf.

```txt
.\bin\Debug\Packager.exe .\assets\sponza\sponza.gltf
```

There are currently some hard coded asset paths in the level JSON file and in Editor.cpp that I need to clean up. The project will halt immediately if those assets are not there. They must be removed and replaced with other rsy assets present on the system.

### Hardware

I have only tested this on Nvidia 3070 and 3060 gpus. I don't know if this application works on AMD or other GPUs at this time.