diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-15 23:22:50 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-04-15 23:23:51 +0300 |
commit | d8d1f637b1b0775048ef797d10b96b42c79bf4f8 (patch) | |
tree | ea90f2883d7c4cfc84726eeffc0b3e117da96b7f /source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl | |
parent | dd6fcd2f21090971f0298f95c2c0d51d7a85608a (diff) |
Eevee: Shadows: Transition to individual face rendering.
This gets rid of the need of a geom shader and instancing.
Both are pretty slow compared to the new method.
The only moment the old method could be better is when scene is filled
with lots of objects and most of the objects in the shadow map appear
on every layer.
But even then, we could optimize the culling and minimize the overhead.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl index 77c873c1503..b5e54c8747a 100644 --- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl @@ -8,37 +8,6 @@ #define LUT_SIZE 64 -#ifdef SHADOW_SHADER -layout(std140) uniform shadow_render_block { - mat4 ShadowMatrix[6]; - mat4 FaceViewMatrix[6]; - vec4 lampPosition; - float cubeTexelSize; - float storedTexelSize; - float nearClip; - float farClip; - int shadowSampleCount; - float shadowInvSampleCount; -}; - -flat in int shFace; /* Shadow layer we are rendering to. */ - -/* Replacing viewBlock */ -#define ViewMatrix FaceViewMatrix[shFace] -#define ViewProjectionMatrix ShadowMatrix[shFace] -/* TODO optimize */ -#define ProjectionMatrix \ -mat4(vec4(1.0, 0.0, 0.0, 0.0), \ - vec4(0.0, 1.0, 0.0, 0.0), \ - vec4(0.0, 0.0, -(farClip + nearClip) / (farClip - nearClip), -1.0), \ - vec4(0.0, 0.0, (-2.0 * farClip * nearClip) / (farClip - nearClip), 0.0)) - -#define ViewMatrixInverse inverse(ViewMatrix) -#define ViewProjectionMatrixInverse inverse(ViewProjectionMatrix) -#define ProjectionMatrixInverse inverse(ProjectionMatrix) -#define CameraTexCoFactors vec4(1.0f, 1.0f, 0.0f, 0.0f) -#endif - /* Buffers */ uniform sampler2D colorBuffer; uniform sampler2D depthBuffer; |