Improved CMakeLists for clearer project setup with added library support for stb_image.

This commit is contained in:
Joey de Vries
2017-01-18 21:56:31 +01:00
parent 96ced3c198
commit c5b584deb9
8 changed files with 7213 additions and 4046 deletions

View File

@@ -85,7 +85,7 @@ void main()
// Cook-Torrance BRDF
float NDF = DistributionGGX(N, H, roughness);
float G = GeometrySmith(N, V, L, roughness);
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
vec3 nominator = NDF * G * F;
float denominator = 4 * max(dot(V, N), 0.0) * max(dot(L, N), 0.0) + 0.001; // 0.001 to prevent divide by zero.

View File

@@ -112,7 +112,7 @@ void main()
// Cook-Torrance BRDF
float NDF = DistributionGGX(N, H, roughness);
float G = GeometrySmith(N, V, L, roughness);
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
// kS is equal to Fresnel
vec3 kS = F;

2
src/stb_image.cpp Normal file
View File

@@ -0,0 +1,2 @@
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"