◀️ 🔼 🔽 ▶️

3D Game Shaders For Beginners

Building The Demo

Building The Demo

The demonstration is available in both C++ and Python.

Python

The Python version does not require compilation. You just need to install the dependencies.

C++

Before you can try out the C++ demo program, you'll have to build it first.

Dependencies

For Python, you will need to install Panda3D and numpy.

pip install panda3d numpy

For 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.

Linux

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/demonstration

Now 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 \
  -lpthread

For more help, see the Panda3D manual.

Mac

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-beginners

Now 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 \
  -lpthread

For more help, see the Panda3D manual.

Windows

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-beginners

For more help, see the Panda3D manual.

Copyrights

(C) 2019 David Lettier (lettier.com)
(C) 2026 Shivam Kumar

◀️ 🔼 🔽 ▶️