/Compute-Shader-Testing

Compute shader OpenGL experiments

Primary LanguageC++

Compute Shaders

OpenGL template project with wrappers around the basic OpenGL objects.

This contains two examples: Application and ApplicationMinimal.

Application has lighting, while ApplicationMinimal is just simple scene with no lighting.

Building and Running

Windows (Visual Studio)

The easiest way to build is to use vcpkg and install dependencies through this:

vcpkg install sfml
vcpkg install imgui
vcpkg install glm
vcpkg integrate install

Then open the Visual Studio project file to build and run.

Linux

Pre-requisites

Install Vcpkg and other required packages using your distribution's package manager:

git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh

# These are required to build some packages
sudo apt install cmake make autoconf libtool pkg-config

# The following are required for SFML
sudo apt install libx11-dev xorg-dev freeglut3-dev libudev-dev

Ensure paths are set correctly:

export VCPKG_ROOT=/path/to/vcpkg
export PATH=$VCPKG_ROOT:$PATH

RECOMMENDED: Add the above lines to your .bashrc or .zshrc file:

echo 'export VCPKG_ROOT=/path/to/vcpkg' >> ~/.bashrc
echo 'export PATH=$VCPKG_ROOT:$PATH' >> ~/.bashrc

Build and Run

To build, at the root of the project:

vcpkg install # First time only
sh scripts/build.sh

To run, at the root of the project:

sh scripts/run.sh

To build and run in release mode, simply add the release suffix:

sh scripts/build.sh release
sh scripts/run.sh release

Video

https://www.youtube.com/watch?v=YiFvHH5bDAE

Resources

https://antongerdelan.net/opengl/compute.html

https://www.khronos.org/opengl/wiki/Image_Load_Store

https://raytracing.github.io/books/RayTracingInOneWeekend.html

https://www.youtube.com/watch?v=nF4X9BIUzx0