diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-07-10 16:02:25 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-07-10 16:31:34 +0300 |
commit | 1a43e081873415754950766edaddad220adf67bc (patch) | |
tree | 6a4e61b2337606daf442973d9f82e1d56b906a98 /source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl | |
parent | 97f90d48a02eef89949532b166f57ea178ee5a87 (diff) |
Eevee: LightCache: Initial Implementation
This separate probe rendering from viewport rendering, making possible to
run the baking in another thread (non blocking and faster).
The baked lighting is saved in the blend file. Nothing needs to be
recomputed on load.
There is a few missing bits / bugs:
- Cache cannot be saved to disk as a separate file, it is saved in the DNA
for now making file larger and memory usage higher.
- Auto update only cubemaps does update the grids (bug).
- Probes cannot be updated individually (considered as dynamic).
- Light Cache cannot be (re)generated during render.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl index 644b449c03e..22194c22f39 100644 --- a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl @@ -256,7 +256,7 @@ void CLOSURE_NAME( PlanarData pd = planars_data[i]; /* Fade on geometric normal. */ - float fade = probe_attenuation_planar(pd, worldPosition, worldNormal, roughness); + float fade = probe_attenuation_planar(pd, worldPosition, (gl_FrontFacing) ? worldNormal : -worldNormal, roughness); if (fade > 0.0) { if (!(ssrToggle && ssr_id == outputSsrId)) { @@ -404,7 +404,7 @@ void CLOSURE_NAME( spec_occlu = 1.0; } - out_spec += spec_accum.rgb * ssr_spec * spec_occlu * float(specToggle); + out_spec += spec_accum.rgb * ssr_spec * spec_occlu; #endif #ifdef CLOSURE_REFRACTION @@ -419,7 +419,12 @@ void CLOSURE_NAME( vec2 C_brdf_lut = texture(utilTex, vec3(C_uv, 1.0)).rg; vec3 C_fresnel = F_ibl(vec3(0.04), brdf_lut) * specular_occlusion(NV, final_ao, C_roughness); - out_spec += C_spec_accum.rgb * C_fresnel * float(specToggle) * C_intensity; + out_spec += C_spec_accum.rgb * C_fresnel * C_intensity; +#endif + +#ifdef CLOSURE_GLOSSY + /* Global toggle for lightprobe baking. */ + out_spec *= float(specToggle); #endif /* ---------------------------------------------------------------- */ |