Blender Git Loki
Git Commits -> Revision 846cdf5
Revision 846cdf5 by Clément Foucault (master) November 22, 2017, 03:51 (GMT) |
Eevee : SSS : Add Translucency support. This adds the possibility to simulate things like red ears with strong backlight or material with high scattering distances. To enable it you need to turn on the "Subsurface Translucency" option in the "Options" tab of the Material Panel (and of course to have "regular" SSS enabled in both render settings and material options). Since the effect is adding another overhead I prefer to make it optional. But this is open to discussion. Be aware that the effect only works for direct lights (so no indirect/world lighting) that have shadowmaps, and is affected by the "softness" of the shadowmap and resolution. Technical notes: This is inspired by http://www.iryoku.com/translucency/ but goes a bit beyond that. We do not use a sum of gaussian to apply in regards to the object thickness but we precompute a 1D kernel texture. This texture stores the light transmited to a point at the back of an infinite slab of material of variying thickness. We make the assumption that the slab is perpendicular to the light so that no fresnel or diffusion term is taken into account. The light is considered constant. If the setup is similar to the one assume during the profile baking, the realtime render matches cycles reference. Due to these assumptions the computed transmitted light is in most cases too bright for curvy objects. Finally we jitter the shadow map sample per pixel so we can simulate dispersion inside the medium. Radius of the dispersion is in world space and derived by from the "soft" shadowmap parameter. Idea for this come from this presentation http://www.iryoku.com/stare-into-the-future (slide 164). |
Commit Details:
Full Hash: 846cdf53187174ac87dd24af4b7b0d413db4ad03
Parent Commit: ff810f0
Lines Changed: +394, -106
14 Modified Paths:
/release/scripts/startup/bl_ui/properties_material.py (+4, -1) (Diff)
/source/blender/draw/engines/eevee/eevee_lights.c (+2, -0) (Diff)
/source/blender/draw/engines/eevee/eevee_materials.c (+19, -5) (Diff)
/source/blender/draw/engines/eevee/eevee_private.h (+3, -2) (Diff)
/source/blender/draw/engines/eevee/eevee_subsurface.c (+0, -2) (Diff)
/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl (+1, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl (+2, -2) (Diff)
/source/blender/draw/engines/eevee/shaders/lamps_lib.glsl (+136, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl (+58, -0) (Diff)
/source/blender/gpu/GPU_material.h (+3, -2) (Diff)
/source/blender/gpu/intern/gpu_material.c (+152, -89) (Diff)
/source/blender/gpu/shaders/gpu_shader_material.glsl (+8, -3) (Diff)
/source/blender/makesdna/DNA_material_types.h (+1, -0) (Diff)
/source/blender/makesrna/intern/rna_material.c (+5, -0) (Diff)
/source/blender/draw/engines/eevee/eevee_lights.c (+2, -0) (Diff)
/source/blender/draw/engines/eevee/eevee_materials.c (+19, -5) (Diff)
/source/blender/draw/engines/eevee/eevee_private.h (+3, -2) (Diff)
/source/blender/draw/engines/eevee/eevee_subsurface.c (+0, -2) (Diff)
/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl (+1, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl (+2, -2) (Diff)
/source/blender/draw/engines/eevee/shaders/lamps_lib.glsl (+136, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl (+58, -0) (Diff)
/source/blender/gpu/GPU_material.h (+3, -2) (Diff)
/source/blender/gpu/intern/gpu_material.c (+152, -89) (Diff)
/source/blender/gpu/shaders/gpu_shader_material.glsl (+8, -3) (Diff)
/source/blender/makesdna/DNA_material_types.h (+1, -0) (Diff)
/source/blender/makesrna/intern/rna_material.c (+5, -0) (Diff)