[Bf-blender-cvs] [11b3954346b] blender2.8: Eevee: Irradiance Grid: Make the influence shape corners round
Clément Foucault
noreply at git.blender.org
Thu Nov 15 18:17:40 CET 2018
Commit: 11b3954346b1e4ee2d70d8f4efa2e1a57c9fbef8
Author: Clément Foucault
Date: Thu Nov 15 17:52:55 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB11b3954346b1e4ee2d70d8f4efa2e1a57c9fbef8
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.
===================================================================
M source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
===================================================================
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)
More information about the Bf-blender-cvs
mailing list