diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-07-25 20:03:07 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-07-25 23:07:35 +0300 |
commit | 4fd70c99a5a37db00ea26b8e5efa7d351e5e1e2b (patch) | |
tree | ae1290d15d970ba72597485f3bde4e043e660aae /source/blender/draw/engines/eevee/shaders/lightprobe_planar_downsample_frag.glsl | |
parent | 8c3ecc9651f9b3eaa2eddd659e6299c7f4c0588b (diff) |
Eevee: SSR: Add support for planar probes.
This add the possibility to use planar probe informations to create SSR.
This has 2 advantages:
- Tracing is less expensive since the hit is found much quicker.
- We have much less artifact due to missing information.
There is still area for improvement.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/lightprobe_planar_downsample_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lightprobe_planar_downsample_frag.glsl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_planar_downsample_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_planar_downsample_frag.glsl index fa70fb5590f..c2ef085ca01 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_planar_downsample_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_planar_downsample_frag.glsl @@ -13,8 +13,9 @@ out vec4 FragColor; void main() { /* Reconstructing Target uvs like this avoid missing pixels */ - vec2 uvs = floor(gl_FragCoord.xy) * 2.0 * texelSize + texelSize; + vec2 uvs = gl_FragCoord.xy * 2.0 / vec2(textureSize(source, 0).xy); +#if 0 /* Slower and does not match the main framebuffer downsampling. */ /* Downsample with a 4x4 box filter */ vec4 d = texelSize.xyxy * vec4(-1, -1, +1, +1); @@ -24,4 +25,7 @@ void main() FragColor += texture(source, vec3(uvs + d.zw, layer)).rgba; FragColor /= 4.0; +#endif + + FragColor = texture(source, vec3(uvs, layer)); }
\ No newline at end of file |