Add Float Curve for GN and Shader nodes.
Possible replacement for Attribute Curve Map node.
Uses code for Vector Curves as a basis with some minor adjustments.
Lookup data is still stored as XYZ with only the X channel used.
Differential D12683
Nodes: Add Float Curve Authored by Charlie Jolly (charlie) on Sep 29 2021, 12:38 AM. Tags None Subscribers None
Details Add Float Curve for GN and Shader nodes. Possible replacement for Attribute Curve Map node. Uses code for Vector Curves as a basis with some minor adjustments.
Diff Detail
Event TimelineComment Actions A couple comments:
Comment Actions Fix factor interpolation on GN. Comment Actions I get a compiler error currently: home/jacques/blender-git/blender/intern/cycles/render/nodes.cpp
In file included from /home/jacques/blender-git/blender/intern/cycles/render/../util/util_types.h:28,
from /home/jacques/blender-git/blender/intern/cycles/render/../util/util_aligned_malloc.h:20,
from /home/jacques/blender-git/blender/intern/cycles/render/../util/util_array.h:23,
from /home/jacques/blender-git/blender/intern/cycles/render/../graph/node_type.h:20,
from /home/jacques/blender-git/blender/intern/cycles/render/../graph/node.h:21,
from /home/jacques/blender-git/blender/intern/cycles/render/../render/nodes.h:20,
from /home/jacques/blender-git/blender/intern/cycles/render/nodes.cpp:17:
/home/jacques/blender-git/blender/intern/cycles/render/nodes.cpp: In instantiation of ‘static const ccl::NodeType* ccl::FloatCurveNode::register_type() [with T = ccl::FloatCurveNode]’:
/home/jacques/blender-git/blender/intern/cycles/render/nodes.cpp:6536:1: required from here
/home/jacques/blender-git/blender/intern/cycles/render/../util/util_defines.h:119:13: error: cannot convert ‘float*’ to ‘ccl::float3*’ in assignment
119 | __tmp = (type *)NULL; \
| ^
/home/jacques/blender-git/blender/intern/cycles/render/../graph/node_type.h:187:5: note: in expansion of macro ‘CHECK_TYPE’
187 | CHECK_TYPE(T::name, datatype); \
| ^~~~~~~~~~
/home/jacques/blender-git/blender/intern/cycles/render/../graph/node_type.h:308:3: note: in expansion of macro ‘SOCKET_DEFINE’
308 | SOCKET_DEFINE(name, \
| ^~~~~~~~~~~~~
/home/jacques/blender-git/blender/intern/cycles/render/nodes.cpp:6545:3: note: in expansion of macro ‘SOCKET_IN_FLOAT’
6545 | SOCKET_IN_FLOAT(value, "Value", 0.0f);
| ^~~~~~~~~~~~~~~Comment Actions For the Cycles part, this should use a float array instead of float3. It's more code but from the public API point of view it makes no sense to have a float curve node have a float3 array. Comment Actions Cycles, use float array instead of float3 array. Comment Actions Got one inline comment, but other than that, looks good.
| ||||||||||