- Download all 3 files and place them at the same folder as your VS solution
- Build shaderc and move the executable to the same folder. If you get the original executable from the build directory, remember to rename it to shaderc.exe instead of shadercRelease.exe
- Open your solution into VS, right click on the project and select Build Dependencies > Build Customizations...
- Click Find existing... and select the bgfxshader.targets file you just created
- Add .sc files to your project and they should be treated as bgfx shaders
To verify that the new target works correctly you can right click on an .sc file and select Properties. Item Type property should read "bgfx Shader"
- IMPORTANT: The include directory for bgfx_shader.sh is hardcoded to ../bgfx/src in the batch file. Change it to your prefered location.
- Vertex shaders should have a vs_ prefix and fragment shaders should have a fs_ prefix
- You can exclude .sc files from the build from their properties page. E.g. varying.def.sc shouldn't be compiled (it's actually ignored by the batch file).
- The script creates 4 folders (dx9, dx11, glsl and metal) under the folder where the .sc file is located.
- Specify additional include directories from within VS and pass them to the batch file.