HJGraphics is a very simple 3D graphic framework based on OpenGL API, and also my attempt to build a relatively complete tiny 3D graphic framework from the ground up. It is a part of my bachelor graduation project as well.
By using HJGraphics, you can create OpenGL environment easily and draw some funny 3D objects with only a few lines of codes.
eg.
Window window(windowWidth,windowHeight,windowTitle);
Camera camera(cameraPosition,cameraDirection);
auto box=make_shared<Box>(boxWidth,boxDepth,boxHeight);
auto pointLight=make_shared<PointLight>(lightPosition);
auto scene=make_shared<Scene>();
scene->addCamera(camera);
scene->addObject(box);
scene->addLight(pointLight);
auto renderer=make_shared<DeferredRenderer>();
renderer->setMainScene(scene);
window.renderer=renderer;
window.run();
HJGraphics has...
- Window : a GLFW wrapped window system(
now HJGraphics supports Qt, see HJGraphics-Qt). - Camera
- Scene : an easy way to manage and draw objects.
- Object : a few build-in 3D objects support include
- Model
- Basic geometries like cylinder, box and plane.
- Skybox
- Coordinate and grid
- Light : build-in basic lights support and unlimited number of lights in a single scene.
- Point light
- Parallel light
- Spot light
- Shadow for 3 kinds of lights above
- Material : BlinnPhong material and UE4 workflow PBR material.
- Renderer : deferred and forward shading support, SSAO, text rendering, IBL
- Post-Processing : Screen Space Reflection, Motion Blur(Both camera & object), HDR, Depth of Field, Chromatic aberration, Bloom
Fig.1 unlimited number of lights and shadow support
Fig.2 PBR shading
Fig.3 model loading support (only obj
format fully supported now)
Fig.4 basic material
- Assimp 5.0.1 64bit
- GLFW 3.3 64bit
- GLAD
- glm 0.9.9.8
- stb
- freetype 2.10.2
- SPDLOG
Build passed on Windows 10(Visual Studio 2017) and macOS 10.14(CLion)
- SSAO
- Load scene via JSON file
- HDR
- Deferred shading
- PBR Shading
- Motion Blur
- Animater(basic)
- Depth of field
- SSR
Amazing tutorials : learnopengl.com
Shader tutorials : 3D Game Shaders For Beginners
OpenGL API reference : OpenGL wiki
Useful book : OpenGL Programming Guide