Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/nodes.cpp
| Context not available. | |||||
| return enm; | return enm; | ||||
| } | } | ||||
| static ShaderEnum image_interpolation_init() | |||||
| { | |||||
| ShaderEnum enm; | |||||
| enm.insert("Linear", 0); | |||||
| enm.insert("None", 1); | |||||
| return enm; | |||||
| } | |||||
| ShaderEnum ImageTextureNode::color_space_enum = color_space_init(); | ShaderEnum ImageTextureNode::color_space_enum = color_space_init(); | ||||
| ShaderEnum ImageTextureNode::projection_enum = image_projection_init(); | ShaderEnum ImageTextureNode::projection_enum = image_projection_init(); | ||||
| ShaderEnum ImageTextureNode::interpolation_enum = image_interpolation_init(); | |||||
| ImageTextureNode::ImageTextureNode() | ImageTextureNode::ImageTextureNode() | ||||
| : TextureNode("image_texture") | : TextureNode("image_texture") | ||||
| Context not available. | |||||
| builtin_data = NULL; | builtin_data = NULL; | ||||
| color_space = ustring("Color"); | color_space = ustring("Color"); | ||||
| projection = ustring("Flat"); | projection = ustring("Flat"); | ||||
| interpolation = ustring("Linear"); | |||||
| projection_blend = 0.0f; | projection_blend = 0.0f; | ||||
| animated = false; | animated = false; | ||||
| Context not available. | |||||
| ImageTextureNode::~ImageTextureNode() | ImageTextureNode::~ImageTextureNode() | ||||
| { | { | ||||
| int interp = 0; | |||||
| if(image_manager) | if(image_manager) | ||||
| image_manager->remove_image(filename, builtin_data); | image_manager->remove_image(filename, builtin_data, interp); | ||||
| } | } | ||||
| ShaderNode *ImageTextureNode::clone() const | ShaderNode *ImageTextureNode::clone() const | ||||
| Context not available. | |||||
| ShaderOutput *color_out = output("Color"); | ShaderOutput *color_out = output("Color"); | ||||
| ShaderOutput *alpha_out = output("Alpha"); | ShaderOutput *alpha_out = output("Alpha"); | ||||
| int interp = 0; | |||||
| if(interpolation == "None") | |||||
| interp = 1; | |||||
| image_manager = compiler.image_manager; | image_manager = compiler.image_manager; | ||||
| if(is_float == -1) { | if(is_float == -1) { | ||||
| bool is_float_bool; | bool is_float_bool; | ||||
| slot = image_manager->add_image(filename, builtin_data, animated, is_float_bool, is_linear); | slot = image_manager->add_image(filename, builtin_data, animated, is_float_bool, is_linear, interp); | ||||
| is_float = (int)is_float_bool; | is_float = (int)is_float_bool; | ||||
| } | } | ||||
| Context not available. | |||||
| compiler.parameter("projection_blend", projection_blend); | compiler.parameter("projection_blend", projection_blend); | ||||
| compiler.parameter("is_float", is_float); | compiler.parameter("is_float", is_float); | ||||
| compiler.parameter("use_alpha", !alpha_out->links.empty()); | compiler.parameter("use_alpha", !alpha_out->links.empty()); | ||||
| compiler.parameter("interpolation", interpolation); | |||||
| compiler.add(this, "node_image_texture"); | compiler.add(this, "node_image_texture"); | ||||
| } | } | ||||
| Context not available. | |||||
brecht: This should not be static. Can be const if you want, but no reason to have it static. If… | |||||
| EnvironmentTextureNode::~EnvironmentTextureNode() | EnvironmentTextureNode::~EnvironmentTextureNode() | ||||
| { | { | ||||
| static int interpolation = 0; | |||||
| if(image_manager) | if(image_manager) | ||||
| image_manager->remove_image(filename, builtin_data); | image_manager->remove_image(filename, builtin_data, interpolation); | ||||
| } | } | ||||
| ShaderNode *EnvironmentTextureNode::clone() const | ShaderNode *EnvironmentTextureNode::clone() const | ||||
| Context not available. | |||||
| ShaderOutput *color_out = output("Color"); | ShaderOutput *color_out = output("Color"); | ||||
Not Done Inline ActionsSame comment as above. brecht: Same comment as above. | |||||
| ShaderOutput *alpha_out = output("Alpha"); | ShaderOutput *alpha_out = output("Alpha"); | ||||
| static int interpolation = 0; | |||||
| image_manager = compiler.image_manager; | image_manager = compiler.image_manager; | ||||
| if(slot == -1) { | if(slot == -1) { | ||||
| bool is_float_bool; | bool is_float_bool; | ||||
| slot = image_manager->add_image(filename, builtin_data, animated, is_float_bool, is_linear); | slot = image_manager->add_image(filename, builtin_data, animated, is_float_bool, is_linear, interpolation); | ||||
| is_float = (int)is_float_bool; | is_float = (int)is_float_bool; | ||||
| } | } | ||||
| Context not available. | |||||
This should not be static. Can be const if you want, but no reason to have it static. If remove_image accepts InterpolationType it can just pass INTERPOLATION_NONE directly though.