Eevee: First Shadows implementation
authorClément Foucault <foucault.clem@gmail.com>
Mon, 10 Apr 2017 10:06:17 +0000 (12:06 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Mon, 10 Apr 2017 10:36:32 +0000 (12:36 +0200)
commitf2f16a2568c2006b46ba0daa851961355a42f20b
tree105dd51aacc1d5ca57d9da13bbaad4baf78df7d4
parent0811d089b4b88ff553b6514771b1e324025e15ad
Eevee: First Shadows implementation

Using Texture Arrays to store shadow maps so less texture slots are used when shading. This means a large amount of shadows can be supported.

Support Projection Shadow Map for sun like in old BI/BGE.

Support Cube Shadow Map for Point/Spot/Area lights. the benefit of using it for spot light is that the spot angle does not change shadow resolution (at the cost of more memory used). The implementation of the cubemap sampling is targeted for 3.3 core. We rely on 2D texture arrays to store cubemaps faces and sample the right one manualy. Significant performance improvement can be done using Cubemap Arrays on supported hardware.

Shadows are only hardware filtered. Prefiltered shadows and settings comming next.
16 files changed:
source/blender/draw/CMakeLists.txt
source/blender/draw/engines/eevee/eevee.c
source/blender/draw/engines/eevee/eevee_lights.c
source/blender/draw/engines/eevee/eevee_private.h
source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
source/blender/draw/engines/eevee/shaders/shadow_frag.glsl [new file with mode: 0644]
source/blender/draw/engines/eevee/shaders/shadow_geom.glsl [new file with mode: 0644]
source/blender/draw/engines/eevee/shaders/shadow_vert.glsl [new file with mode: 0644]
source/blender/draw/intern/DRW_render.h
source/blender/draw/intern/draw_manager.c
source/blender/gpu/GPU_lamp.h
source/blender/gpu/GPU_viewport.h
source/blender/gpu/intern/gpu_framebuffer.c
source/blender/gpu/intern/gpu_lamp.c
source/blender/gpu/intern/gpu_texture.c