Skip to content

camenduru/TostEngine-vulkan-live-shader-editor-standalone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍞 TostEngine Vulkan Live Shader Editor Standalone

A native Vulkan live shader coding engine inspired by Shadertoy.

2026-01-02.19-49-56.1.mp4

Features

  • Real-time shader hot-reload: Edit shader files and see changes instantly
  • Full-screen quad rendering: ShaderToy-style rendering on a -1 to 1 clip space quad
  • Uniforms available:
    • ubo.time - elapsed time in seconds
    • ubo.resolution - viewport resolution (x, y)
    • ubo.model, ubo.view, ubo.projection - transformation matrices

Project Structure

live-shader/
├── CMakeLists.txt       # Build configuration
├── build.bat            # Windows build script
├── src/
│   └── main.cpp         # Main Vulkan application
└── shaders/
    ├── vert.glsl        # Vertex shader
    └── frag.glsl        # Fragment shader

Building

Windows (Visual Studio)

build.bat

Or manually:

mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64
cmake --build . --config Release

Usage

  1. Run the application: .\build\Release\live-shader.exe
  2. A window will open displaying your shader output
  3. Edit the shader files in the shaders/ folder:
    • shaders/vert.glsl - Vertex shader
    • shaders/frag.glsl - Fragment shader
  4. Save the file - the shader will automatically recompile and reload
  5. Check the console for compilation errors or success messages

Shader Inputs

Vertex Shader

#version 450

layout(location = 0) in vec2 aPosition;   // Quad position (-1 to 1)
layout(location = 0) out vec2 vUv;        // UV coordinates (0 to 1)

void main() {
    gl_Position = vec4(aPosition, 0.0, 1.0);
    vUv = aPosition * 0.5 + 0.5;
}

Fragment Shader

#version 450

layout(location = 0) in vec2 vUv;
layout(location = 0) out vec4 fragColor;

layout(binding = 0) uniform UniformBufferObject {
    mat4 model;
    mat4 view;
    mat4 projection;
    float time;
    vec2 resolution;
} ubo;

void main() {
    vec2 uv = gl_FragCoord.xy / ubo.resolution;
    vec3 color = vec3(uv.x, uv.y, 0.5 + 0.5 * sin(ubo.time));
    fragColor = vec4(color, 1.0);
}

Requirements

  • Windows 10+
  • Visual Studio 2022
  • Vulkan SDK 1.4.335.0 or later
  • CMake 3.16+

License

MIT License

About

A native Vulkan live shader coding engine inspired by Shadertoy.

Resources

Stars

Watchers

Forks

Packages

No packages published