diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-18 15:23:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-18 18:52:01 +0300 |
commit | 0e3a2acbfa6998b3a1ec967f3c25f7e12e0cf8fb (patch) | |
tree | dde289c6fbe219951ae5618866b33dfcfa3325e4 /source/blender/nodes/shader | |
parent | 286c34b4abb0436fb370c8d49fd73738dabc0fcf (diff) |
Fix T57457: animated image sequences not working in Eevee.
The dependency graph now handles updating image users to point to the current
frame, and tags images to be refreshed on the GPU. The image editor user is
still updated outside of the dependency graph.
We still do not support multiple image users using a different current frame
in the same image, same as 2.7. This may require adding a GPU image texture
cache to keep memory usage under control. Things like rendering an animation
while the viewport stays fixed at the current frame works though.
Diffstat (limited to 'source/blender/nodes/shader')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_environment.c | 8 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_image.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c index 5b5f6d0d7db..3f6c1b92d8b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c @@ -48,8 +48,14 @@ static void node_shader_init_tex_environment(bNodeTree *UNUSED(ntree), bNode *no static int node_shader_gpu_tex_environment(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) { Image *ima = (Image *)node->id; - ImageUser *iuser = NULL; NodeTexEnvironment *tex = node->storage; + + /* We get the image user from the original node, since GPU image keeps + * a pointer to it and the dependency refreshes the original. */ + bNode *node_original = node->original ? node->original : node; + NodeTexImage *tex_original = node_original->storage; + ImageUser *iuser = &tex_original->iuser; + int isdata = tex->color_space == SHD_COLORSPACE_NONE; GPUNodeLink *outalpha; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c index 7b15555630e..ba5d34a445f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c @@ -67,8 +67,14 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat, bNode *node, bNodeExecDat }; Image *ima = (Image *)node->id; - ImageUser *iuser = NULL; NodeTexImage *tex = node->storage; + + /* We get the image user from the original node, since GPU image keeps + * a pointer to it and the dependency refreshes the original. */ + bNode *node_original = node->original ? node->original : node; + NodeTexImage *tex_original = node_original->storage; + ImageUser *iuser = &tex_original->iuser; + const char *gpu_node_name = (tex->projection == SHD_PROJ_BOX) ? names_box[tex->interpolation] : names[tex->interpolation]; |