This project was inspired Joey de Vries - Learn OpenGL and David Wolff - OpenGL 4.0 Shading Language Cookbook. It will illustrate some of the most common computer graphics techinques used in the industry, including topics such as primitive objects, camera system, texturing, lighting, fragment and geometry shading, shadows and screen-space filters.
Computer graphics is a field in Computer Science which studies methods for digitally synthesizing and manipulating visual content to make computers easier
to interact with, and better
for understanding and interpreting many types of data. It has profound impact in many types of media (graphics design, animation, 3d modelling, medical imaging, image processing, and computer vision among others) and industries (films, television, advertising and video games).
NOTE: The project is configured for Mac OSX using CMake.
- Download and install the CMake.app for
Mac OS X 10.7 or later
- Open
Terminal.app
on your Mac and enter the following commands. - Install
CMake Command Line Tools
for Terminal
% sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
- Clone the project on your Mac and ensure that you have the 'build', 'src', 'Includes', 'Libraries' folders, including 'CMakeLists.txt' and ComputerGraphicsWithOpenGLConfig.h.in files.
% cd ./Downloads
% git clone https://github.com/geoo993/ComputerGraphicsWithOpenGL.git
% cd ./ComputerGraphicsWithOpenGL
% ls
CMakeLists.txt Libraries
README.md
ComputerGraphicsWithOpenGLConfig.h.in build
Includes src
NOTE: Please fetch all the large files from the resources directory using git lfs
% cd ./src/resources
% brew install git lfs
% git lfs install
% git lfs pull
Downloading LFS objects: 53% (101/190), 198 MB | 2.7 MB/s
- Check that all the project libraries are available
% cd ../../Libraries
% ls
libGLEW.2.1.0.dylib libfmodstudioL.dylib
libassimp.4.1.0.dylib libfreeimage.3.17.0.dylib
libfmod.dylib libfreeimageplus.3.17.0.dylib
libfmodL.dylib libfreetype.6.dylib
libfmodstudio.dylib libglfw.3.2.dylib
- Download the missing
libpng16.16.dylib
shared library oflibfreetype.6.dylib
with Homebrew
% brew install libpng
🍺 /usr/local/Cellar/libpng/1.6.37: 27 files, 1.2MB
- Check that cmake is running in Terminal
% cmake --version
cmake version 3.15.2
% which cmake
/usr/local/bin/cmake
- Go to the
build
folder
% cd ../build
and make sure you have installed Xcode Command Line Tools
and pointing towards the Xcode Developer
directory
% xcode-select --install # Install Command Line Tools if you haven't already.
% sudo xcode-select --switch /Library/Developer/CommandLineTools # Enable command line tools
or alternatively specify to use the full Xcode.app (if you have it installed) with:
% sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
- Configure and generate the Xcode project inside the
build
folder
% cmake -G "Xcode" ../
% ls
CMakeCache.txt ComputerGraphicsWithOpenGLConfig.h
CMakeFiles cmake_install.cmake
CMakeScripts src
ComputerGraphicsWithOpenGL.xcodeproj
- The Xcode project should be available in the
build
folder of the project. Open the Xcode projectComputerGraphicsWithOpenGL.xcodeproj
and set the active scheme toComputerGraphicsWithOpenGL
target in theBuild Scheme
Find and select: Product => Scheme => Choose Scheme => ComputerGraphicsWithOpenGL
- Build and Run ComputerGraphicsWithOpenGL in Xcode
Find and select: Product => Run
or using Terminal
% cmake --build . --target ComputerGraphicsWithOpenGL --config Debug
% ./src/Debug/ComputerGraphicsWithOpenGL
- Move in the scene with Arrow Keys ➡️ ⬅️ ⬆️ ⬇️
- Toggle movement speed with O
- Move pointlight Up with Q
- Move pointlight Down with A
- Move pointlight Forward with S
- Move pointlight Backward with D
- Move pointlight Right with E
- Move pointlight Left with W
- Select pointlight with I
-
Move and Hold screen with 🖱️
-
Zoom with 🖱️ (Mouse wheel)
- Click on Buttons or drag Sliders with 🖱️
- Cube
- Sphere
- Quad
- Torus
- Torus Knot
- Metal Balls
- Teapot
- Planar Terrain and HeightMap Terrain
- Trolley
Image Based Lighting (IBL)
Blinn Phong Lighting
HDR Tone Mapping
Physically Based Rendering (PBR)
Bump Mapping
Parallax Mapping
Chromatic Aberration
Environment Mapping (Reflection and Refraction)
Disintergration
Fireball (Geometry Shader)
Wireframe (Geometry Shader)
Porcupine / Display Normal (Geometry Shader)
Toon / Cell Shading
Fast Approximate Anti-Aliasing (FXAA) (Geometry Shader)
Color Inversion
Gray Scale
Kernel
Kernel Blur
Sobel Edge Detection
Frei-Chen Edge Detection
Screen Wave
Swirl
Night Vision
Lens Circle
Posterization
Dream Vision
Pixelate
Pixelation
Knitted Pixelation
Frosted Glass Pixelation Effect
Frosted Glass Screen Wave Effect
Cross Hatching
Predators Thermal Vision
Toonify
Shockwave
Fish Eye
Barrel Distortion
Multi-Screen Fish Eye
Fish Eye Lens
Fish Eye / Anti-Fish Eye
Gaussian Blur
Blur
Radial Blur
Motion Blur
Vignetting
Bright Parts
Bloom
Lens Flare
Screen Space Ambient Occlusion
Depth Testing
Depth Mapping
Directional Shadow Mapping
Omnidirectional Shadow Mapping
Deferred Rendering
Rain Drops
Palette Quantization And Dithering
Distorted TV
RGB Display
Retro Parallax
Money Filter
Microprism Mosaic
Bayer Matrix Dithering
Julia Freak
Heart Blend
EM Interference
Cubic Lens Distortion
Cel Shaderish
Cartoon Video
- Assimp
- FMOD
- FreeImage
- FreeType
- The OpenGL Extension Wrangler Library (GLEW)
- OpenGL Mathematics (GLM)
- GLFW
- Joey de Vries - Learn OpenGL.
- David Wolff - OpenGL 4.0 Shading Language Cookbook.
- Geeks3D
- Shadertoy