diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-04-25 19:46:59 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-04-25 19:47:20 +0300 |
commit | 041a50291b73b727fdf8bc3192de2917e8563ce0 (patch) | |
tree | 4a01f82c9241b3fa3037ccdaac113d4a86be447e /source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl | |
parent | 00f5c621a65b6bc9847776b2542588835fb4054c (diff) |
Eevee: Make default shaders works.
- Added New Batch cache routine to get the split mesh for each material. (optimization needed)
- Did some shader modifications to create default_frag and support a somwhat correct fresnel for lamps (to finish)
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl index 5762ca45b71..fddc9c54cb2 100644 --- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl @@ -271,6 +271,13 @@ vec3 mrp_area(LightData ld, ShadingData sd, vec3 dir, inout float roughness, out return closest_point_on_rectangle / len; } +/* Fresnel */ +vec3 F_schlick(vec3 f0, float cos_theta) +{ + float fac = pow(1.0 - cos_theta, 5); + return f0 + (1.0 - f0) * fac; +} + /* GGX */ float D_ggx_opti(float NH, float a2) { |