diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-07-23 18:24:35 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-07-23 18:24:35 +0300 |
commit | bb3c8afb77a820c4204c5b8fc296f637b9d2c42a (patch) | |
tree | f800b7fe67c1e4fd529321fc5b6adf5648b80952 /source/blender/editors/space_view3d | |
parent | bcc3cc8c8fd6468486654334ec0dd56f2b3e095c (diff) |
Depsgraph integration for hair strand nodes (horrible).
The depsgraph now invalidates the strand shader when the nodes are changed.
As mentioned in the previous commit, this happens through an operation in
the object GEOMETRY component for each strand modifier. This is messy, only
useful until we have truly granular modifier integration in the depsgraph.
Invalidating the shader is currently done just by setting a flag. The actual
freeing and subsequent lazy-rebuild of the shader is done in the drawing
thread, because during the threaded depsgraph update we don't have a valid
OpenGL context. This needs to be sorted out for future viewport recode.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawstrands.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/drawstrands.c b/source/blender/editors/space_view3d/drawstrands.c index 3dfe049cd8a..a74361cdd3b 100644 --- a/source/blender/editors/space_view3d/drawstrands.c +++ b/source/blender/editors/space_view3d/drawstrands.c @@ -140,6 +140,8 @@ void draw_strands(Scene *scene, View3D *UNUSED(v3d), RegionView3D *rv3d, smd->gpu_buffer = GPU_strands_buffer_create(converter); GPUDrawStrands *buffer = smd->gpu_buffer; + if (smd->tag & MOD_STRANDS_TAG_UPDATE_SHADER) + BKE_strands_invalidate_shader(smd->strands); if (!strands->gpu_shader) { GPUStrandsShaderParams shader_params; shader_params.fiber_primitive = fiber_primitive; |