DX11 PBR Renderer
![](https://static.wixstatic.com/media/bd49bc_6948f5a8af3642809cec1b0f9b46f31af000.jpg/v1/fill/w_866,h_487,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/bd49bc_6948f5a8af3642809cec1b0f9b46f31af000.jpg)
Project Overview
Image Based Lighting
For Image Based Lighting(IBL), I used split sum approximation, the first part is pre-filtered environment map, in whicn I precalculate the convolution for the HDR image according to different roughness value. For the second part, the BRDF part of the specular integral, I used precalculated LUT. Horizontal texture coordinate is n⋅ωi, and vertical texture coordinate is roughness value.
![image.png](https://static.wixstatic.com/media/bd49bc_f5c0d77f172a495eae00e6dac600432a~mv2.png/v1/fill/w_600,h_88,al_c,q_85,enc_avif,quality_auto/bd49bc_f5c0d77f172a495eae00e6dac600432a~mv2.png)
![](https://static.wixstatic.com/media/bd49bc_b75bc8beef274230a67dd0f979dafe36f000.jpg/v1/fill/w_553,h_311,al_c,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/bd49bc_b75bc8beef274230a67dd0f979dafe36f000.jpg)
IBL with Different Textures
HLSL Shader Code of IBL
Physically-Based Rendering
Every PBR objects need 5 textures: Albedo, Normal, Metallic, Roughness, Ambient Occlusion. For each Texture, I used differen slot to store all texture. If some objects are lack of certain texture, I will pass a pure white texture RGBA(255, 255, 255, 255) to shader, in case the final result is too dark
![pbr1.png](https://static.wixstatic.com/media/bd49bc_733e70067611476a92522130bbd040db~mv2.png/v1/fill/w_600,h_330,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/pbr1.png)
Texture List in PBR Pipeline
Game Code of Binding Different Textrues in Slots
In the specular part of BRDF I used Trowbridge-Reitz GGX for D, the Fresnel-Schlick approximation for F, and the Smith's Schlick-GGX for G.
![pbr.png](https://static.wixstatic.com/media/bd49bc_08690061e81349f3a5cb45cf69939cfa~mv2.png/v1/fill/w_523,h_260,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/pbr.png)
PBR with Diffrent Roughness and Metallic
HLSL Shader Code of PBR
Game Code of Creating Spheres with Different Roughness and Metallic
Lighting Models
![](https://static.wixstatic.com/media/bd49bc_a691a43cec2c4d099ecc2fc56f408242f000.jpg/v1/fill/w_518,h_311,al_c,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/bd49bc_a691a43cec2c4d099ecc2fc56f408242f000.jpg)
Some Lighting Models (Cell Shading, BackLight, OrenNayar .etc)
HLSL Shader Code of other Lighting Models
Screenshots
![](https://static.wixstatic.com/media/bd49bc_df0073a387c7492c8e233e60f6bdc2ac~mv2.png/v1/fill/w_980,h_485,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/bd49bc_df0073a387c7492c8e233e60f6bdc2ac~mv2.png)
![](https://static.wixstatic.com/media/bd49bc_7eebccba17d445b7a41eb68780a4a145~mv2.png/v1/fill/w_980,h_488,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/bd49bc_7eebccba17d445b7a41eb68780a4a145~mv2.png)
![](https://static.wixstatic.com/media/bd49bc_b58d847185cd45d899e44059f2e6d567~mv2.png/v1/fill/w_980,h_488,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/bd49bc_b58d847185cd45d899e44059f2e6d567~mv2.png)
![](https://static.wixstatic.com/media/bd49bc_df0073a387c7492c8e233e60f6bdc2ac~mv2.png/v1/fill/w_980,h_485,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/bd49bc_df0073a387c7492c8e233e60f6bdc2ac~mv2.png)