The demonstration is available in both C++ and Python.
The Python version does not require compilation. You just need to install the dependencies.
Before you can try out the C++ demo program, you'll have to build it first.
For Python, you will need to install Panda3D and
numpy.
pip install panda3d numpyFor C++, before you can compile the example code, you'll need to install Panda3D for your platform. Panda3D is available for Linux, Mac, and Windows.
Start by installing the Panda3D SDK for your distribution.
Make sure to locate where the Panda3D headers and libraries are. The
headers and libraries are most likely in
/usr/include/panda3d/ and /usr/lib/panda3d/
respectively. You will need to set the P3D_INCLUDE_PATH and
P3D_LIB_PATH environment variables.
Next clone this repository and change directory into it.
git clone https://github.com/ShivamKR12/3d-game-shaders-for-beginners.git
cd 3d-game-shaders-for-beginners/demonstrationNow compile the source code into an object file.
g++ \
-c src/main.cxx \
-o 3d-game-shaders-for-beginners.o \
-std=gnu++11 \
-O2 \
-I/path/to/python/include/ \
-I/path/to/panda3d/include/With the object file created, create the executable by linking the object file to its dependencies.
g++ \
3d-game-shaders-for-beginners.o \
-o 3d-game-shaders-for-beginners \
-L/path/to/panda3d/lib \
-lp3framework \
-lpanda \
-lpandafx \
-lpandaexpress \
-lpandaphysics \
-lp3dtoolconfig \
-lp3dtool \
-lpthreadFor more help, see the Panda3D manual.
Start by installing the Panda3D SDK for Mac.
Make sure to locate where the Panda3D headers and libraries are.
Next clone this repository and change directory into it.
git clone https://github.com/lettier/3d-game-shaders-for-beginners.git
cd 3d-game-shaders-for-beginnersNow compile the source code into an object file. You'll have to find where the Python 2.7 and Panda3D include directories are.
clang++ \
-c main.cxx \
-o 3d-game-shaders-for-beginners.o \
-std=gnu++11 \
-g \
-O2 \
-I/path/to/python/include/ \
-I/path/to/panda3d/include/With the object file created, create the executable by linking the object file to its dependencies. You'll need to track down where the Panda3D libraries are located.
clang++ \
3d-game-shaders-for-beginners.o \
-o 3d-game-shaders-for-beginners \
-L/path/to/panda3d/lib \
-lp3framework \
-lpanda \
-lpandafx \
-lpandaexpress \
-lpandaphysics \
-lp3dtoolconfig \
-lp3dtool \
-lpthreadFor more help, see the Panda3D manual.
Start by installing the Panda3D SDK for Windows.
Make sure to locate where the Panda3D headers and libraries are.
Next clone this repository and change directory into it.
git clone https://github.com/lettier/3d-game-shaders-for-beginners.git
cd 3d-game-shaders-for-beginnersFor more help, see the Panda3D manual.
(C) 2019 David Lettier (lettier.com)
(C) 2026 Shivam Kumar