diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-05-29 13:25:43 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-30 13:25:20 +0300 |
commit | 10f6450ef24ca1e99b3454c76117d877f35541fe (patch) | |
tree | e51aed473eb7bf398cab55abf47a889c087c17e4 /source/blender/draw/engines/eevee/shaders/prepass_vert.glsl | |
parent | 501c0b1df8c2db9806481d4e4c4c59008389b426 (diff) |
Eevee: Add support for new Hair geometry system.
This now can shade actual poly strips that mimics cylinders.
This makes hair coverage exact compared to the line method and result in
smoother fading hair.
This does make the sampling a bit more exact but needs more samples to
converge properly.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/prepass_vert.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/prepass_vert.glsl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl b/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl index c756e061d70..1ed4f5f6500 100644 --- a/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl +++ b/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl @@ -7,13 +7,28 @@ layout(std140) uniform clip_block { vec4 ClipPlanes[1]; }; +#ifndef HAIR_SHADER in vec3 pos; +#endif void main() { +#ifdef HAIR_SHADER + float time, thick_time, thickness; + vec3 pos, nor, binor; + hair_get_pos_tan_nor_time( + (ProjectionMatrix[3][3] == 0.0), + ViewMatrixInverse[3].xyz, ViewMatrixInverse[2].xyz, + pos, nor, binor, time, thickness, thick_time); + + gl_Position = ViewProjectionMatrix * vec4(pos, 1.0); + vec4 worldPosition = vec4(pos, 1.0); +#else gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); -#ifdef CLIP_PLANES vec4 worldPosition = (ModelMatrix * vec4(pos, 1.0)); +#endif + +#ifdef CLIP_PLANES gl_ClipDistance[0] = dot(vec4(worldPosition.xyz, 1.0), ClipPlanes[0]); #endif /* TODO motion vectors */ |