acvictor / GLSL-Starter

A starter GLSL application written in C++.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GLSL Starter

A starter OpenGL shader application written in C++ for Linux. It includes directional, point and spot lights, simulates ambient, diffuse and specular lighting as well as a shadow map with percentage closer filtering (PCF). It supports 3D model loading via Assimp and texture loading via STB Image.

NMPC NMPC

Requirements

  • OpenGL 3.3 and above
  • GLEW
  • GLFW
  • GLM
  • STB Image
  • Assimp

To install

sudo apt install mesa-utils mesa-common-dev
sudo apt-get install libglew-dev
sudo apt-get install libglfw3-dev
sudo apt-get install libglm-dev
git clone https://github.com/nothings/stb.git
sudo cp stb/stb_image.h /usr/include/
git clone https://github.com/assimp/assimp.git
cd assimp
cmake CMakeLists.txt
make -j4
sudo make install
export LD_LIBRARY_PATH=/usr/local/lib

Execution

To compile and execute run

g++ -std=c++11 main.cpp src/Mesh.cpp src/Shader.cpp src/Window.cpp src/Camera.cpp src/Texture.cpp src/Light.cpp src/Material.cpp src/DirectionalLight.cpp src/PointLight.cpp src/SpotLight.cpp src/Model.cpp src/ShadowMap.cpp -w -lGL -lglfw -lGLEW -lassimp -o exec

./exec

Note

run

export LD_LIBRARY_PATH=/usr/local/lib

if you see error while loading shared libraries: libassimp.so.4: cannot open shared object file: No such file or directory

About

A starter GLSL application written in C++.

License:MIT License


Languages

Language:C++ 89.9%Language:GLSL 9.5%Language:Makefile 0.5%Language:C 0.1%