diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-03-11 19:12:01 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-03-11 19:12:16 +0300 |
commit | 7dd0be9554ae7a728ded1a95d4709a93b68301b4 (patch) | |
tree | 52a097fd8edd1128def41fcda6bed64e8c6b39b7 /source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl | |
parent | c476c36e400883d929a7149def8dcb6ad6157a86 (diff) |
EEVEE: Replace octahedron reflection probe by cubemap array
We implement cubemap array support for EEVEE's lightcache reflection probes.
This removes stretched texels and bottom hemisphere seams artifacts caused
by the octahedral projection previously used.
This introduce versioning code for the lightcache which will discard any
lightcache version that is not compatible.
Differential Revision: https://developer.blender.org/D7066
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl index 06c31272ecd..00eb3c7e200 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl @@ -33,29 +33,9 @@ vec3 octahedral_to_cubemap_proj(vec2 co) void main() { - vec2 uvs = gl_FragCoord.xy * texelSize; - - /* Add a N pixel border to ensure filtering is correct - * for N mipmap levels. */ - uvs = (uvs - paddingSize) / (1.0 - 2.0 * paddingSize); - - /* edge mirroring : only mirror if directly adjacent - * (not diagonally adjacent) */ - vec2 m = abs(uvs - 0.5) + 0.5; - vec2 f = floor(m); - if (f.x - f.y != 0.0) { - uvs = 1.0 - uvs; - } - - /* clamp to [0-1] */ - uvs = fract(uvs); - - /* get cubemap vector */ - vec3 cubevec = octahedral_to_cubemap_proj(uvs); - vec3 N, T, B, V; - vec3 R = normalize(cubevec); + vec3 R = normalize(worldPosition); /* Isotropic assumption */ N = V = R; |