Themperror
Game/Engine Programmer
Back to Home.
ThempX11
Link to the Github.
Type
Tech Demo / Renderer
Language
C++
API's
D3D11
Libraries
"Dear Imgui" as Debug UI
Comments
Made from scratch.
Written tools to export images in .DDS (using DirectXTex) and models in my own custom format (Using Assimp).
Description
This was one of the two 6-month long project that were part of my final study year. The initial goal was to focus on shadowing techniques but after I implemented the first one, the decision to add PBR was quickly added as well.
The scene is created with a deferred renderer, meaning I first render all the geometry to a few rendertargets called a G(eometry)-Buffer and then perform lighting on it.
The G-Buffer
Click on images to view the full versions.
My G-Buffer exists out of the following data (left to right):
-Diffuse,
-World Normals,
-World Position,
-F0 (Index of Refraction),
-Misc (R: Roughness, G: Metallicness, B: EmissiveStrength, A: isEmissive),
-Depth.
The Shadowing
After this step I calculate the shadows for all the lights, for Point Lights I use something called Single Pass Render-to-Cubemap, which uses geometry shaders to work on multiple viewports at once, rather than doing every face one by one.
For Directional Lights I had implemented a few types of shadowing, this being the normal shadowmapping and PCF (including multisampled variants) and Cascaded Shadow Mapping which wasn't completely finished yet as it still suffers from swimming edges due to the light not moving in pixel-space.
I also used a technique from DOOM (which can be found here) called Shadow Map Atlassing.
I wrote a simple command&conquer algorithm to reserve space in the shadow atlas for each light so I could simply call "ObtainTextureArea(size)" which would obtain a suitable area for the light to render to.
PBR
For PBR I used sources from all over the place, most notably LearnOpenGL.com which has a nice guide on PBR, though a bit incomplete in my opinion so the PBR is a quite standard implementation.
Sadly Google's Filament guide didn't exist yet when I was working on it as it's a godly source for PBR.
The scene is composed out of the extracted models from the Elemental Demo, which can be found on the Unreal Engine's Marketplace. Sadly as all the PBR related information is done on the materials inside the engine, all I got exported was the diffuse and normal maps. I wrote my own material system in order to gain some control of all the values and manually made a texture describing the PBR info per material. I am no artist however so if something looks off that's probably my fault with creating the textures.
Final result looks like this: