Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-11-15 19:52:55 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-15 20:16:30 +0300
commit11b3954346b1e4ee2d70d8f4efa2e1a57c9fbef8 (patch)
tree1e8440d14984a2011a8c403609360fba1254357b /source/blender/draw/engines/eevee/shaders
parent21b0f74a6f7720b562583b5c67e551aece44b4d4 (diff)
Eevee: Irradiance Grid: Make the influence shape corners round
This makes it easier to add corrective light grids without having ugly blending corners revealing the shape of the grid bounds.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
-rw-r--r--source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
index 04a1697f9df..e0cba826c76 100644
--- a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
@@ -134,9 +134,9 @@ float probe_attenuation_planar(PlanarData pd, vec3 W, vec3 N, float roughness)
float probe_attenuation_grid(GridData gd, mat4 localmat, vec3 W, out vec3 localpos)
{
localpos = transform_point(localmat, W);
-
- float fade = min(1.0, min_v3(1.0 - abs(localpos)));
- return saturate(fade * gd.g_atten_scale + gd.g_atten_bias);
+ vec3 pos_to_edge = max(vec3(0.0), abs(localpos) - 1.0);
+ float fade = length(pos_to_edge);
+ return saturate(-fade * gd.g_atten_scale + gd.g_atten_bias);
}
vec3 probe_evaluate_cube(int pd_id, vec3 W, vec3 R, float roughness)