Attempt to create simple shader demo system with support for rocket and png textures.
glfw, rocket, jsoncpp, bass, glew, lodepng and glText are included in project.
- glfw version 3.3.7 https://www.glfw.org/
- rocket https://github.com/emoon/rocket
- jsoncpp version 0.10.7 https://github.com/open-source-parsers/jsoncpp
- bass version 2.4.13.8 http://www.un4seen.com/bass.html
- glew version 2.2.0 http://glew.sourceforge.net/
- lodepng https://lodev.org/lodepng/
- glText https://github.com/vallentin/glText
C++ compiler is needed, and on linux g++ can found easily from package management, but on windows mingw-64 works well.
- https://www.mingw-w64.org/downloads/ choose MSYS2 (other options might be viable, but MSYS2 is known to work)
After MSYS2 is installed open MSYS2 and type
pacman -S --needed base-devel mingw-w64-i686-toolchain
(will install 32 bit version)
Make sure visual studio code knows where to find g++.exe
. Two options are provided here, and option number 2 is preferred.
- Make sure that miDebuggerPath is correct in
lauch.json
. Checkc_cpp_configuration.json
that compilerPath is correct as well, to ensure that intellisense is working correctly. NOTE do not commit those changes to repository, as they are specific to your system. - add mingw bin folder to your PATH, for example
C:\development\msys64\mingw32\bin
(preferred way)
More information about compiler installation: C/C++ for Visual Studio Code
CMake is needed. Download it from https://cmake.org/ and add it to your path.
Install CMake and CMake Tools extensions for Visual Studio Code, both can be found from Visual Studio Extensions
Ninja is needed, Download it from https://ninja-build.org/ and install it somewhere and add installation path to your path, so cmake can find it.
Example of c_cpp_properties.json
is provided and you should copy c_cpp_properties_example.json
to .vscode
and rename it to c_cpp_properties.json
and make changes accordinug to your setup.
Create output folder for executable(ie. bin/debug) as compiler cannot create folders by itself.
Make sure that mingw is available, easy way to handle this is to add mingw folder (e.g. "C:\MinGW\bin") to PATH variable
Make sure that .vscode/settings.json
has "C_Cpp.intelliSenseEngine": "Tag Parser"
Use following command to install required libraries
sudo apt-get install g++-multilib libglew-dev xorg-dev
Use command CMake: Configure to create configuration. Configuration will appear in build folder. Use command CMake: Build to compile shader system.
- First build by clicking small build icon, indicated by number 1 in following picture
- debug by pressing small insect icon, indicated by number 2 in following picture
This creates it's own launch.json
on the fly and shader system runs on build
folder.
To run shader-system in release mode execute following steps. Release mode means mode where you write shader code, sync graphics with music and present your demo at party.
- Make directory where you want to store shader-system.
- Build relese version.
- Copy bass.dl from libs/bass-24-win/ to newly created folder
- Copy glew32.dl from libs/glew-2.2.0/bin/Release to newly created folder
- Copy glfw3.dll from /build/libs/glfw-3.3.7/src to newly created folder
When demo system is executed without parameters, it defaults configuration file to "configuration.json".
Be sure that shaders, music and textures defined in "configuration.json" exist, as shader system does not give any error messages if some files are missing.
- start rocket client
- start "ShaderSystem.exe" Tracks defined in "configuration.json" will appear on rocket. Open fragment shader defined in "configuration.json" and verify that uniform variables corresponding to rocket tracks are present. When changes have been made to fragment shader press "r" to reload shader. Press "s" to turn tune on or off.
Included example song Monplaisir - Feet Gone Wild Speed Version: http://ccmixter.org/files/Monplaisir/56217