diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-08 00:24:38 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-08 00:24:38 +0400 |
commit | e6a84eb1b542e7cafe5e760530882bb806f3c433 (patch) | |
tree | e3d7b9f8dab6c2d55ec0d45297ba281599f3e92f /intern/cycles/blender/blender_shader.cpp | |
parent | f44e80e6387601dea6e4e0801d0a387455a02d31 (diff) |
Cycles: add light falloff node, with quadratic/linear/constant falloff and a
smoothing factor to reduce high values near the light.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Light_Falloff
Note that this was already possible to do manually with the Ray Length, but
this adds a convenient node for it. This commit also makes the mapping node
min/max option work, fixing #31348.
Diffstat (limited to 'intern/cycles/blender/blender_shader.cpp')
-rw-r--r-- | intern/cycles/blender/blender_shader.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index 52d97753db3..b33de789631 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -97,6 +97,13 @@ static void get_tex_mapping(TextureMapping *mapping, BL::ShaderNodeMapping b_map mapping->translation = get_float3(b_mapping.translation()); mapping->rotation = get_float3(b_mapping.rotation()); mapping->scale = get_float3(b_mapping.scale()); + + mapping->use_minmax = b_mapping.use_min() || b_mapping.use_max(); + + if(b_mapping.use_min()) + mapping->min = get_float3(b_mapping.min()); + if(b_mapping.use_max()) + mapping->max = get_float3(b_mapping.max()); } static ShaderNode *add_node(BL::BlendData b_data, ShaderGraph *graph, BL::ShaderNode b_node) @@ -323,6 +330,10 @@ static ShaderNode *add_node(BL::BlendData b_data, ShaderGraph *graph, BL::Shader node = new LightPathNode(); break; } + case BL::ShaderNode::type_LIGHT_FALLOFF: { + node = new LightFalloffNode(); + break; + } case BL::ShaderNode::type_TEX_IMAGE: { BL::ShaderNodeTexImage b_image_node(b_node); BL::Image b_image(b_image_node.image()); |