This is a small project created for the purpose of practicing what I've learned in LearnOpenGL. It showcases the rendering of 1 million instanced cubes.
Before building, ensure you have the required dependencies:
- CMake (version 3.30 or newer)
- C++ Compiler (GCC, Clang, MSVC, or MinGW)
- Git (to clone the repository)
- Install CMake
- Install Visual Studio with the C++ Development Tools OR Install MinGW-w64 for MinGW builds
brew install cmake ninjasudo apt update
sudo apt install cmake g++ make clang gitSince the project uses submodules (e.g., GLFW, GLM), make sure to clone it with the --recursive flag:
git clone --recursive https://github.com/PsionicAlch/hello-instance-rendering.gitIf you already cloned the repository without --recursive, you can manually initialize submodules with:
cd hello-instance-rendering
git submodule update --init --recursiveNavigate to the project directory and create a separate build folder:
cd hello-instance-rendering
mkdir -p build
cd buildRun cmake to generate the build files.
cmake .. -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=ReleaseYou can also use "MinGW Makefiles" if using MinGW.
cmake .. -DCMAKE_BUILD_TYPE=ReleaseNow, compile the project using the generated build system.
cmake --build . --config Releasecmake --build . -- -j$(nproc) # Use all CPU cores for faster buildsAfter a successful build, the compiled executable can be found in:
build/output/HelloInstanceRenderingWindows
cd output
HelloInstanceRendering.exeMacOS/Linux
cd output
./HelloInstanceRenderingTo update your local copy, pull the latest changes and update submodules:
git pull --recurse-submodules
git submodule update --recursive --remoteEnsure CMake is installed and available in your system’s PATH. Try running:
cmake --versionIf it doesn’t work, reinstall CMake or add it to your PATH.
- Ensure you have the correct dependencies installed.
- Try deleting the build folder and reconfiguring:
rm -rf build # macOS/Linux
rmdir /s /q build # Windows (PowerShell)
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .