Modern OpenGL (3+) sample program.
It displays a (very simplified) 3D eel (with 2 materials, normal mapping and togglable animation) in a skybox with 2 sources of light. There is also a test-sphere present 'behind' the camera (assuming default camera orientation). In the scene there are 2 sources of light (white - 'sun' and red - red sphere).
- Working in OpenGL 3.3 Core profile
- Most computations happen in shaders (almost zero CPU usage)
- Improved Blinn-Phong attenuated shading model
- Normal mapping
- N light sources per scene, M materials per object (with alpha-blending - it's possible to apply a non-specular material on a very glossy one)
- Modular/OOP design
- WSAD for camera movement
- Mouse for camera rotation (when enabled - see below)
- F to toggle fullscreen
- M to toggle mouse capture (disabled on startup)
- T to toggle animations (rotations)
- OpenGL 3.3 capable graphic card, e.g. Intel HD Graphics 3000 (Intel Core 2nd gen CPUs), NVidia GeForce 8 series, ATI/AMD Radeon HD 2000 series and newer
- C++11 compatible compiler (tested on modern GCC and VC++)
- For Windows: installed VC++ 2015 redistributable package (due to included precompiled libpng file)
- For non-Windows OS: installed OpenGL, GLUT, GLEW, zlib and libpng libraries (Windows headers and pre-compiled .lib files are included)
- Preparation: put your textures in eel/Resources/* and/or adjust paths in main.cpp (some textures, generated by me in GIMP, are present but some aren't there due to copyright reasons)
- Windows: use eel.snl Visual Studio solution file or eel/eel.vcxproj project file (open with VS or import to your IDE of choice). Build and run.
- Linux/*nix: use provided Makefile (
make
ormake run
should be enough).
- Execution caveat: hardcoded relative paths to textures (in main.cpp). Run from 'eel' directory (with Resources directory in it - see Makefile) or modify the paths (or change the way they're passed). Using VC++ run target or
make run
will handle it for you though. - Mouse capture may not be working in MacOS (GLUT limitations; should work with up-to-date GLUT though)
- The OOP design of the program is quite poor
- The animations are being calculated on CPU (possible performance bottleneck)
- Vlad Badoiu, Sergiu Craitoiu and Ana Mihut for their great tutorial on modern OpenGL.
- Christian Schüler for his note on normal mapping without precomputed tangents
This software is licensed under MIT License (see LICENSE file).