Shader SDK (WIN)
In this tutorial we wil show how to setup Beam Shader SDK on Windows OS
The Shader SDK's current version can be characterized as an 'early developer preview', with a high possibility of encountering unusual issues and bugs.
You will need Microsoft Visual Studio, community edition will do just fine. In this tutorial I have used the 2022 version.
You will also need a Python 3.x installed and available in the path (check by typing 'python' in the command line)
Building Shader SDK
- Clone Shader SDK repository from here: https://github.com/BeamMW/shader-sdk
- Open Developer Command Prompt for VS. This can be done from either Tools Menu within the VS IDE or by finding an entry in the Start menu items
- Change directory to the location of the shader-sdk and run:
This will operation will install and build all the necessary components.
Creating a new Shader Project
- Open a Developer Console and create a new folder for your Shader project. We will use 'vault' in our example
2. Set the following environment variables to point to the location of you shader-sdk and wasi-sdk:
3. Run the following command:
shade create_project <project name>
In our case:
c:\Code\shader-sdk\shade create_project vault
This will initialize the structure of the Shader project, which should look as follows:
Building the Shader Project
In the Visual Studio, chose 'Open A Local Folder' from the starter screen
Navigate to the project folder and clock 'Select Folder'. This will generate a CMake project. The end result should be visible in the Solution Explorer window and look like this:
Choose the wasm32-Release build configuration
This will build the .wasm files which will be located in the following folder:
In case something goes wrong with this step. Try the following before calling support:
- Delete the 'out' folder using Windows Explorer
- In the 'Project' menu, choose 'Delete Cache and Reconfigure'
- Rebuild the 'wasm32-Release'
Now you are ready to start coding your Shader!