diff options
author | Matt Ebb <matt@mke3.net> | 2007-05-31 10:55:02 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2007-05-31 10:55:02 +0400 |
commit | 17a219e3c0af09d682179f3e087472dbd27b6540 (patch) | |
tree | 93799f39a6a85cc89005ddf986ef09b55d1a315a /source/blender/blenkernel | |
parent | 6057ab05f0b4d4ab7a84a142bcdeee65fffe97d9 (diff) |
== Shader nodes ==
* Geometry node: Front/back output
This is used as a mask for determining whether you're looking at the front side or back side of a mesh, useful for blending materials, my practical need was giving different materials to the pages of a magazine: http://mke3.net/blender/etc/frontback-h264.mov
Give 1.0 if it's the front side, and 0.0 if it's the back side.
* Extended material node
This is the same as the material node, but gives more available inputs and outputs, (basically just connecting up more of ShadeInput and ShadeResult to the node). I didn't want to add it to the normal simple Material node since you don't always need all that stuff, and it would make the node huge, but when you do need it, it's nice to have it.
== Comp nodes ==
* Invert node
Inverting is something that happens all the time in a node setup, and this makes it easier. It's been possible to invert previously by adding a mix node and subtracting the input from 1.0, but it's not the best way of doing it. This node:
- makes it a lot faster to set up, rather than all the clicking required with the mix node
- is a lot more usable amidst a complex comp setup, when you're looking at a node tree, it's very helpful to be able to see at a glance what's going on. Using subtract for inverting is easily mixed up with other nodes in which you are actually subtracting, not inverting, and looks very similar to all the other mix nodes that usually litter a comp tree.
- has options to invert the RGB channels, the Alpha channel, or both. This saves adding lots of extra nodes (separate RGBA, subtract, set alpha) when you want to do something simple like invert an alpha channel. I'd like to add this option to other nodes too.
There's also a shader node version too.
* Also a few fixes that I committed ages ago, but seems to have been overwritten in Bob's node refactor:
- adding new compbufs to the set alpha and alphaover nodes when you have only one noodle connected to the lower input
- making the fac value on RGB curves still work when there's nothing connected to it
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 11 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index bace38651ea..44266a1c854 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -204,6 +204,8 @@ struct ShadeResult; #define SH_NODE_MATH 115 #define SH_NODE_VECT_MATH 116 #define SH_NODE_SQUEEZE 117 +#define SH_NODE_MATERIAL_EXT 118 +#define SH_NODE_INVERT 119 /* custom defines options for Material node */ @@ -293,9 +295,16 @@ void set_node_shader_lamp_loop(void (*lamp_loop_func)(struct ShadeInput *, str #define CMP_NODE_COMBHSVA 246 #define CMP_NODE_MATH 247 #define CMP_NODE_LUMA_MATTE 248 - #define CMP_NODE_BRIGHTCONTRAST 249 #define CMP_NODE_GAMMA 250 +#define CMP_NODE_INVERT 251 + +/* channel toggles */ +#define CMP_CHAN_RGB 1 +#define CMP_CHAN_A 2 +#define CMP_CHAN_R 4 +#define CMP_CHAN_G 8 +#define CMP_CHAN_B 16 /* filter types */ #define CMP_FILT_SOFT 0 diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 842e07cebe7..e7b7b36aaa4 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2322,6 +2322,9 @@ static void registerCompositNodes(ListBase *ntypelist) nodeRegisterType(ntypelist, &cmp_node_curve_rgb); nodeRegisterType(ntypelist, &cmp_node_mix_rgb); nodeRegisterType(ntypelist, &cmp_node_hue_sat); + nodeRegisterType(ntypelist, &cmp_node_brightcontrast); + nodeRegisterType(ntypelist, &cmp_node_gamma); + nodeRegisterType(ntypelist, &cmp_node_invert); nodeRegisterType(ntypelist, &cmp_node_alphaover); nodeRegisterType(ntypelist, &cmp_node_zcombine); @@ -2361,9 +2364,6 @@ static void registerCompositNodes(ListBase *ntypelist) nodeRegisterType(ntypelist, &cmp_node_flip); nodeRegisterType(ntypelist, &cmp_node_displace); nodeRegisterType(ntypelist, &cmp_node_mapuv); - - nodeRegisterType(ntypelist, &cmp_node_brightcontrast); - nodeRegisterType(ntypelist, &cmp_node_gamma); } static void registerShaderNodes(ListBase *ntypelist) @@ -2383,9 +2383,11 @@ static void registerShaderNodes(ListBase *ntypelist) nodeRegisterType(ntypelist, &sh_node_squeeze); nodeRegisterType(ntypelist, &sh_node_camera); nodeRegisterType(ntypelist, &sh_node_material); + nodeRegisterType(ntypelist, &sh_node_material_ext); nodeRegisterType(ntypelist, &sh_node_value); nodeRegisterType(ntypelist, &sh_node_rgb); nodeRegisterType(ntypelist, &sh_node_texture); + nodeRegisterType(ntypelist, &sh_node_invert); } void init_nodesystem(void) |