Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/crossgl/crossvl

Tool for loading and testing native shaders translated from crosstl
https://github.com/crossgl/crossvl

apple directx game-development gamedev linux macos metal opengl windows

Last synced: 8 days ago
JSON representation

Tool for loading and testing native shaders translated from crosstl

Awesome Lists containing this project

README

        


CrossGL logo

------------------------------------------------------------------------




Website icon



Documentation icon



Demos icon



Design icon




GitHub issues


GitHub forks


GitHub stars


PRs Welcome


Discord



# 🛠 CrossVL

CrossVL is an in-house tool for loading and testing transpiled shader files. The transpiled shader files are generated using [CrossTL](https://github.com/CrossGL/crosstl).
- Metal Shaders
- GLSL Shaders
- HLSL Shaders

| Platform | DX11 | DX12 | OpenGL | Metal | Vulkan |
|----------|---------------|-----------------|-------------|---------------|-----------------|
| **Windows** | In Progress | Not Implemented | In Progress | Not Supported | Not Implemented |
| **Linux** | Not Supported | Not Supported | In Progress | Not Supported | Not Implemented |
| **MacOSX** | Not Supported | Not Supported | Not Supported | In Progress | Not Implemented |

# 📊 Build Status
[![Windows](https://github.com/CrossGL/crossvl/actions/workflows/windows.yml/badge.svg?branch=main)](https://github.com/CrossGL/crossvl/actions/workflows/windows.yml)

[![MacOSX](https://github.com/CrossGL/crossvl/actions/workflows/macosx.yml/badge.svg)](https://github.com/CrossGL/crossvl/actions/workflows/macosx.yml)

[![Linux](https://github.com/CrossGL/crossvl/actions/workflows/linux.yml/badge.svg)](https://github.com/CrossGL/crossvl/actions/workflows/linux.yml)

# 📚 Project Structure

The project is divided into two sub projects

- **VisualizerCore**: Static library that contains the core functionality
- **VisualizerApp**: Contains the platform independent GUI application that depends on the Core

# 📜 Getting started

To build the project ensure you have the following toolsets and external libraries installed.
- [Xmake](https://xmake.io/)
- C++23 compiler

### External Dependencies

- [SDL2](https://libsdl.org/)
- NCurses (linux/mac only)

## Clone the repository

```
git clone https://github.com/CrossGL/crossvl.git
```

## Load Build Macros

The repo comes with a couple helper xmake macros. Load these macros by running the [LoadMacros.bat](./LoadMacros.bat) or [LoadMacros.sh](./LoadMacros.sh) file depending on the OS. **You only need to run this bat script only once, or if you delete the generated *`.xmake`* folder**.

After running the script the following macros will be imported (case insensitive):

- **BuildAllConfigs**: Builds the visualizer for both debug and release configurations
- **Clean**: Cleans the xmake configs and targets
- **DeepClean**: Similar to the *Clean* macro but also deletes the build folder
- **WatchDir**: Compiles the project on every Edit and Save.
- **GenVS**: Generates Visual Studio 2022 solution files
- **GenXCode**: Generates XCode project files

You can run these above macros using the following command

```bash
xmake macro
```

## Choosing The Build Configuration

Before compiling the project you can also set the build config

To make use of the debug config

```bash
xmake f -m debug
```

To make use of the release config

```bash
xmake f -m release
```

## Compiling The Project

### Using The Macros

Build all the configs

```bash
xmake macro BuildAllConfigs
```

### Compiling Using Visual Studio

Generate VS 2022 files

```bash
xmake macro GenVS
```

This will generate the solution files in the vsxmake2022 folder

### Compiling Using CMake

Generate CMakeLists.txt

```bash
xmake project -k cmakelists
```

This will generate the CMakeLists.txt in the root folder

# 🌈 Example Usage

To test your own `.obj` models, place the model file in the `Samples/ModelLoading/Assets/` directory. Then, update the filename in `ModelLoading.cpp` to match your `.obj` file.

Here `barrel.obj` model is used to show as an example, the output would look like :


animated

*Get the `barrel.obj` model from Output folder to test it out yourself.

# 🙌 Contributing

When contributing to the project. Ensure the project passes the compilation test locally on your PC.

```bash
xmake rhitest -p
```
Where the valid platforms are:
- windows
- linux
- macosx

This will run a series of matrix test for each valid API for that platform (e.g. for macosx it will test compilation for metal and vulkan). Make sure to test in both debug and release build configs.

The complete testing process should look as follows (using windows as example):
```bash
xmake f -m debug
xmake rhitest -p windows

xmake f -m release
xmake rhitest -p windows
```

The expected output should be such that all projects compile and link successfully

# 🤝 Community

Stay connected and follow our latest updates and announcements.

- [Twitter](https://x.com/crossGL_)
- [LinkedIn](https://www.linkedin.com/company/crossgl/?viewAsMember=true)
- [Discord Channel](https://discord.com/invite/uyRQKXhcyW)
- [YouTube](https://www.youtube.com/channel/UCxv7_flRCHp7p0fjMxVSuVQ)

If you like our work, please help us by starring the repo 🌟


Feel free to leave us feedback on Discord if you have any suggestions.


See you there!