1 // This file has been automatically generated from resource file src/Shaders/PBRCookTorrance.glsl
3 static const char Shaders_PBRCookTorrance_glsl[] =
4 "//! Calculates Cook-Torrance BRDF.\n"
5 "vec3 occPBRCookTorrance (in vec3 theView,\n"
7 " in vec3 theNormal,\n"
8 " in vec3 theBaseColor,\n"
9 " in float theMetallic,\n"
10 " in float theRoughness,\n"
13 " vec3 aHalf = normalize (theView + theLight);\n"
14 " float aCosV = max(dot(theView, theNormal), 0.0);\n"
15 " float aCosL = max(dot(theLight, theNormal), 0.0);\n"
16 " float aCosH = max(dot(aHalf, theNormal), 0.0);\n"
17 " float aCosVH = max(dot(aHalf, theView), 0.0);\n"
18 " vec3 aCookTorrance = occPBRDistribution (aCosH, theRoughness)\n"
19 " * occPBRGeometry (aCosV, aCosL, theRoughness)\n"
20 " * occPBRFresnel (theBaseColor, theMetallic, theIOR, aCosVH);\n"
21 " aCookTorrance /= 4.0;\n"
22 " return aCookTorrance;\n"