Skip to content

cosmicpotato137/shader-engine

Repository files navigation

Shader Engine

Table of Contents

  1. Introduction
  2. Features
  3. Building the Project
  4. Examples

Introduction

This project is a rendering pipeline for compiling GLSL shaders. It provides a lightweight framework for loading, editing and serializing compute shaders with options for user interaction. Currently, Shader Engine is designed for experimenting learning with shaders, but it can also be modified to support materials systems and mesh rendering.

Shader Engine only supports windows for now, I do have vague plans to get it running on linux. Until then, PRs are welcome!

Features

  • ImGui interface
    • Shader info windows and stack hierarchy
    • Error console
    • Scene view
    • File dialog
  • Realtime shader uniform editing
  • Shader uniform serialization
  • Event system for handling user input

Building the Project

To build this project you can run the following commands:

  1. Clone the repository and submodules
git clone --recurse-submodules https://github.com/cosmicpotato137/shader-engine.git

OR

git clone https://github.com/cosmicpotato137/shader-engine.git
git submodule init
git submodule update
  1. Build the project with CMake
mkdir build
cd build
cmake ..
  1. Compile with VSCode or Visual studio. The config files for VSCode are included, and the Visual Studio solution will be in ./build.

Examples

GLSL Files

All shader examples can be found here.

C++ Files

Most changes that you might want to make to this project before you build are likely either in these files:

  • RenderEngine/RenderLayer.cpp: This file contains an example of Conway's Game of Life, with scalable pixel size and a brush to create your own automata.
  • RenderEngine/SimulationLayer.cpp: This file contains a particle system that is run using either a boid or a slime shader to update the agent positions.
  • RenderEngine/main.cpp: There is no way to switch the examples at runtime (yet) but layers can be added or removed by commenting any of these lines:
app->PushLayer(std::make_shared<EditorLayer>()); // Particle systems