diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-06-17 00:50:40 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-06-19 11:47:56 +0300 |
commit | 5c67ac2236581532c4ce13448db457d33dd4e863 (patch) | |
tree | 208c2de6599d4fcfe1672d9f321fdd04d5baf374 /source/blender/draw/engines/eevee/shaders/prepass_vert.glsl | |
parent | 539225db8111796c2e194b13a5e4081fe487684a (diff) |
Eevee: Add special shader for depth prespass.
This way we can extend it to output more data (like motion vectors).
Add a variation that uses clip distances.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/prepass_vert.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/prepass_vert.glsl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl b/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl new file mode 100644 index 00000000000..6f26a815736 --- /dev/null +++ b/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl @@ -0,0 +1,18 @@ + +uniform mat4 ModelViewProjectionMatrix; +uniform mat4 ModelMatrix; +#ifdef CLIP_PLANES +uniform vec4 ClipPlanes[1]; +#endif + +in vec3 pos; + +void main() +{ + gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); +#ifdef CLIP_PLANES + vec4 worldPosition = (ModelMatrix * vec4(pos, 1.0)); + gl_ClipDistance[0] = dot(worldPosition, ClipPlanes[0]); +#endif + /* TODO motion vectors */ +} |