KarmaView is an example OpenGL 4.3 framework which allows the user to configure and test parameters of a Physically Based Renderer – also including other advanced rendering techniques.
Some of the features include:
- Dynamic selection of BRDF factors (Fresnel, Geometry, Normals, Sampling).
- Configurable Alchemy Screen-Space Ambient Occlusion.
- Unfiltered Per-Fragment Motion Blur.
- Configurable Filmic Tone Mapping (via. Uncharted 2).
- HDR Image Based Lighting for ambient contribution.
- ~20 Metallic/Roughness (400 object maximum) for demoing PBS.
- Scene Settings for floor/objects (Metallic, Roughness, BaseColor).
- ~10 Temperature-colored Spotlights with Exponential Shadow Mapping.
This project was created during my last semester at DigiPen Institute of Technology over 3 months. The reason I decided to take on a graphics role is because – despite attending a game development school – I had very little exposure to graphics technology. Instead of creating a Unity or Unreal project, I opted to challenge myself by creating what would become my first attempt at a modern graphics framework. I learned a lot, and experimented with more than what is available in the 0.1 release, but instead decided to focus my beta release to what I felt comfortable sharing.
What Was Cut?
The major feature that was cut was Area Lights – I couldn’t get them quite right. The area lights that I chose to approximate were based on Frostbite and Unreal 4 lights. Sphere lights I felt pretty comfortable with, but other types of area lights needed a lot more work than what I had time for. In the end, I wrote them off as interesting experiment that wasn’t quite finished. Another big feature that didn’t quite make it in was UI for selecting the Ambient maps. The code is all there to dynamically load the Ambient Radiance and Irradiance maps, however the UI would have required writing another parser for loading the metadata file that links these two maps together. It would have been erroneous to allow the user to load the maps separately, and since I didn’t have time to write the parser I just included one Ambient Map in the executable that is loaded by default. Here are a few pictures showcasing area lights:
The project itself is over as far as I’m concerned – I learned what I needed/wanted to learn, and now I’m moving on to other things. I’m going to be focusing on some other projects now (language parsing, Operating Systems, UI Frameworks). I will eventually re-visit graphics, most likely when the Vulkan API is released and development libraries are made available on Linux. But until then you can enjoy what we’ve made here with KarmaView 0.1, and learn from the articles I have written. More articles are on the way, I promise.
Fun gif Files:
This image is of 5 rectangular area lights moving around a sphere. There is a point where the quaternion for the facing direction switches signs causing the rectangle light to “flip”. This is entirely expected mathematical behavior, because I’m not setting the direction with an up vector. Since there’s no up vector, one is implicitly generated which causes this spin to happen along z.
I almost always play with exposure when adding a new feature. Setting exposure to negative produces some interesting results! In this result we see a pulsating area light. The glob in the center is the immediate area of influence which becomes a very powerful number since we multiply by -n and store the result without the sign bit at the end. The fringes are interesting – we see that the falloff order of the light is blue, green, red.
This is another image playing with negative exposure – It’s a highly reflective ball in the middle of a theatre. The patterns produced are from darker spots in the environment – creating an almost MS Paint trippy forest look. An interesting thing is that the backdrop doesn’t have any decorative features in the actual picture. The yellow is “drawn” by lighter spots.
Windows Installer (x64) – Be sure to run with your Dedicated Graphics Processor!
Build From Source – Requires Qt Creator, Qt 5.4+, C++11, and OpenGL.
Note: I have built it on Linux amd64, confirmed working but with many compiler warnings.
Project’s Google Drive Page – Presentations, notes, etc.
Patch: There are some bugs with this sample depending on the deployed platform. I’m attempting to fix the bugs for Linux and Windows. Just pushed a fix for some warnings and a major issue involving object loading UI. (For some reason, when attempting to load a file immediately on-emit of a signal, all dialog boxes are frozen? Not sure what’s going on here, but I hacked a fix for Open-File.)
Some of these issues still affect the Windows build for the installer above, I have not re-built the installer so you may still experience issues. (Some of the issue involved uninitialized variables, so it may not work on every run until I re-build the installer.)