diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-30 17:42:12 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-30 17:42:12 +0400 |
commit | 452a52575cbc33551017d940ba86dda7a2c8c30b (patch) | |
tree | 741538f4ed22dff243600017940958507fda3f98 /intern/cycles/render/nodes.cpp | |
parent | 54223ed05b7e2840865b5e46ed6d43573ff2b4ae (diff) |
Cycles material preview: fix for generated/packed/movie files
Issue was caused by cycles trying to find builtin images in a main
database and in case of preview render images are not in database,
they're just referenced by shader node tree.
Now builtin images in cycles have got void* pointer to store data
needed to load builtin images.
In case ob blender session, this pointer will store pointer from
PointerRNA for image datablock and used later to construct Image
class based on this pointer.
This also saves database lookup for final render which is nice :)
Reviewed by Brecht.
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 5444299b948..a0a933ef682 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -142,7 +142,7 @@ ImageTextureNode::ImageTextureNode() slot = -1; is_float = -1; filename = ""; - is_builtin = false; + builtin_data = NULL; color_space = ustring("Color"); projection = ustring("Flat"); projection_blend = 0.0f; @@ -156,7 +156,7 @@ ImageTextureNode::ImageTextureNode() ImageTextureNode::~ImageTextureNode() { if(image_manager) - image_manager->remove_image(filename, is_builtin); + image_manager->remove_image(filename, builtin_data); } ShaderNode *ImageTextureNode::clone() const @@ -177,7 +177,7 @@ void ImageTextureNode::compile(SVMCompiler& compiler) image_manager = compiler.image_manager; if(is_float == -1) { bool is_float_bool; - slot = image_manager->add_image(filename, is_builtin, animated, is_float_bool); + slot = image_manager->add_image(filename, builtin_data, animated, is_float_bool); is_float = (int)is_float_bool; } @@ -238,7 +238,7 @@ void ImageTextureNode::compile(OSLCompiler& compiler) tex_mapping.compile(compiler); if(is_float == -1) - is_float = (int)image_manager->is_float_image(filename, false); + is_float = (int)image_manager->is_float_image(filename, NULL); compiler.parameter("filename", filename.c_str()); if(is_float || color_space != "Color") @@ -272,7 +272,7 @@ EnvironmentTextureNode::EnvironmentTextureNode() slot = -1; is_float = -1; filename = ""; - is_builtin = false; + builtin_data = NULL; color_space = ustring("Color"); projection = ustring("Equirectangular"); animated = false; @@ -285,7 +285,7 @@ EnvironmentTextureNode::EnvironmentTextureNode() EnvironmentTextureNode::~EnvironmentTextureNode() { if(image_manager) - image_manager->remove_image(filename, is_builtin); + image_manager->remove_image(filename, builtin_data); } ShaderNode *EnvironmentTextureNode::clone() const @@ -306,7 +306,7 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler) image_manager = compiler.image_manager; if(slot == -1) { bool is_float_bool; - slot = image_manager->add_image(filename, is_builtin, animated, is_float_bool); + slot = image_manager->add_image(filename, builtin_data, animated, is_float_bool); is_float = (int)is_float_bool; } @@ -356,7 +356,7 @@ void EnvironmentTextureNode::compile(OSLCompiler& compiler) tex_mapping.compile(compiler); if(is_float == -1) - is_float = (int)image_manager->is_float_image(filename, false); + is_float = (int)image_manager->is_float_image(filename, NULL); compiler.parameter("filename", filename.c_str()); compiler.parameter("projection", projection); |