diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-05-19 01:33:09 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-05-19 01:35:36 +0300 |
commit | b16eff2bb31f7712a7902bcb550fe858926cfa6b (patch) | |
tree | fcad9041f5e42f57160f0e69ea4480b1aa05c17a /source/blender/draw/engines | |
parent | b3e53d6daaf95860c7a5fd16d79b411dbc7b0295 (diff) |
EEVEE-Next: Fix error on curve prepass caused by velocity commit
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee_next/shaders/eevee_geom_curves_vert.glsl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_curves_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_curves_vert.glsl index a9ee710ec99..87154ba6db1 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_curves_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_curves_vert.glsl @@ -31,14 +31,15 @@ void main() #ifdef MAT_VELOCITY /* Due to the screen space nature of the vertex positioning, we compute only the motion of curve * strand, not its cylinder. Otherwise we would add the rotation velocity. */ - vec3 prv, nxt; - velocity_local_pos_get(pos, hair_get_base_id(), prv, nxt); + int vert_idx = hair_get_base_id(); + vec3 prv, nxt, pos = texelFetch(hairPointBuffer, vert_idx).point_position; + velocity_local_pos_get(pos, vert_idx, prv, nxt); /* FIXME(fclem): Evaluating before displacement avoid displacement being treated as motion but * ignores motion from animated displacement. Supporting animated displacement motion vectors * would require evaluating the nodetree multiple time with different nodetree UBOs evaluated at * different times, but also with different attributes (maybe we could assume static attribute at * least). */ - velocity_vertex(P_prev, P_curr, P_next, motion.prev, motion.next); + velocity_vertex(prv, pos, nxt, motion.prev, motion.next); #endif init_globals(); |