1 // This file has been automatically generated from resource file src/Shaders/PBRFresnel.glsl
3 static const char Shaders_PBRFresnel_glsl[] =
4 "//! Functions to calculate fresnel coefficient and approximate zero fresnel value.\n"
5 "vec3 occPBRFresnel (in vec3 theBaseColor,\n"
6 " in float theMetallic,\n"
9 " theIOR = (1.0 - theIOR) / (1.0 + theIOR);\n"
10 " theIOR *= theIOR;\n"
11 " vec3 f0 = vec3(theIOR);\n"
12 " f0 = mix (f0, theBaseColor.rgb, theMetallic);\n"
16 "vec3 occPBRFresnel (in vec3 theBaseColor,\n"
17 " in float theMetallic,\n"
19 " in float theCosVH)\n"
21 " vec3 f0 = occPBRFresnel (theBaseColor, theMetallic, theIOR);\n"
22 " theCosVH = 1.0 - theCosVH;\n"
23 " theCosVH *= theCosVH;\n"
24 " theCosVH *= theCosVH * theCosVH * theCosVH * theCosVH;\n"
25 " return f0 + (vec3 (1.0) - f0) * theCosVH;\n"
28 "vec3 occPBRFresnel (in vec3 theBaseColor,\n"
29 " in float theMetallic,\n"
30 " in float theRoughness,\n"
32 " in float theCosV)\n"
34 " vec3 f0 = occPBRFresnel (theBaseColor, theMetallic, theIOR);\n"
35 " theCosV = 1.0 - theCosV;\n"
36 " theCosV *= theCosV;\n"
37 " theCosV *= theCosV * theCosV * theCosV * theCosV;\n"
38 " return f0 + (max(vec3(1.0 - theRoughness), f0) - f0) * theCosV;\n"