/ShaderLab

Shaderlab is a tool designed for cross compiling unity shader to other shading languages.

Primary LanguageC++MIT LicenseMIT

ShaderLab

仿Unity Shaderlab的Shader跨平台编译器。使用DirectX Shader Compiler以及GLSLang编译器作为前端,SPIRV-Cross作为后端,将HLSL以及GLSL编译成DXILSPIR-VHLSLMetalGLSL

内置一个ShaderCross可执行程序,可对*.shaderlab编译成对应平台的Shader并以Json的方式输出。

环境

  • Git:安装git,配置好环境。
  • Visual Studio 2017:任意版本即可。
  • CMake:越新越好,至少3.9。
  • Python:任意版本,配置好环境。

构建

  • 打开CMakeGUI
  • Where is the source code选择Path/ShaderLab
  • Where is the build the binaries选择Path/ShaderLab/Build
  • 点击Configure,选择Visual Studio 2017 x64
  • 点击Generate
  • 点击Open Project

ShaderLab

ShaderLab is a tool designed for cross-compiling unity shaderlab to other shading languages.

Prerequisites

  • Git
  • Visual Studio 2017
  • CMake
  • Python

Building

 mkdir Build
 cd Build
 cmake -G "Visual Studio 15" ../

License

MIT License