PDA

View Full Version : Multi-mixer Node?



Psyhke
03-17-2009, 10:40 PM
I'm wondering if anyone knows of a node that is essentially like the native Mixer node, but has multiple inputs (for Color at least). It would be great to quickly attach 3 or 4 color outputs into one node, rather than adding multiple Mixer nodes and chaining them together.

If it doesn't exist..maybe some brilliant person can cook one up in the lab? ;)

I understand there would be choices to be made, such as how do the 4 layers get mixed? In what order? Etc. But even something as simple as mixing all the inputs evenly would be useful. One could also go nuts and start adding mixing, opacity, layer order options. But let's not get ahead of ourselves. :)

dee
03-18-2009, 06:10 AM
Do you know VectorMixer?
http://www.lwplugindb.com/Plugin.aspx?id=c0011e45

Psyhke
03-18-2009, 07:39 PM
Do you know VectorMixer?
http://www.lwplugindb.com/Plugin.aspx?id=c0011e45

No I hadn't seen that one. Thanks for the link. It's close to what I'm looking for, in that it also can mix colors even though it was made for vectors, but the 4 foreground/background inputs are independent of each other. Each has it's own independent output, with no mixing (between 1 thru 4).

DuneBoy
03-20-2009, 06:07 PM
...it also can mix colors even though it was made for vectors...

Internally Colors and Vectors are the same thing, an array of 3 floats. And because the Normal and Bump inputs on the Surface node only accept Vector inputs (which is lame and unneeded) I usually use a Vector output on the nodes I write.

A Multi-Mixer node should be fairly easy to do. In fact, as I started this reply it occurred to me that I had written (but never released) a Comp Layers node which is somewhat similar. When I get a chance I'll check the code and release it. Right now I'm busy trying to port Jovian (http://www.joviancolorpicker.com) to the Mac.

Psyhke
03-20-2009, 06:49 PM
Internally Colors and Vectors are the same thing, an array of 3 floats. And because the Normal and Bump inputs on the Surface node only accept Color inputs (which is lame and unneeded) I usually use a Vector output on the nodes I write.

A Multi-Mixer node should be fairly easy to do. In fact, as I started this reply it occurred to me that I had written (but never released) a Comp Layers node which is somewhat similar. When I get a chance I'll check the code and release it. Right now I'm busy trying to port Jovian (http://www.joviancolorpicker.com) to the Mac.

:beerchug: Wonderful! I would find that very useful. Can't wait to try it out.

Regarding vector input/output versus color. Would there ever be a case that is the reverse of the Normal/Bump surface inputs situation? Such that a color input would needlessly disallow a vector input?

EDIT: Oh, are you the creator of Jovian? Well, now you're going to make me go get the full version. :) (I wanted the swatch library stuff anyhow).

DuneBoy
03-20-2009, 07:12 PM
Regarding vector input/output versus color. Would there ever be a case that is the reverse of the Normal/Bump surface inputs situation? Such that a color input would needlessly disallow a vector input?

I edited my post, I meant to say the Normal/Bump only accept Vector input.

But anyways, I know of no instance where a Color won't accept a Vector input. A node's author can decide to have his node's inputs reject anything he wants. But when the internal data type is the same there wouldn't really be a reason.

I could see rejecting input where the data is different, like connecting a Function node into a Color input. Which will connect although I don't think it'll do anything.

A node of mine you may want to play with is called Input Spy:
http://www.lwplugindb.com/Plugin.aspx?id=c793077b
It'll show you the values that a node is sending out. You can use it to see the color representation of a Vector, or by connecting a color into the Vector input you can see the internal floating point values of a color.

Yep, I wrote Jovian. I just got your PM.

Psyhke
03-20-2009, 07:33 PM
I just ran across the Input Spy recently when searching for a mulitmixer node. Would have been REALLY useful if I knew about it when first starting off with nodes. By now, I pretty much know what sort of data is going in and out of inputs. Still handy to have around though!

So while it's possible in theory that a color input may block a vector type, one could always work around that case by pre-converting the vector to color (output type) with another node, I suppose.

DuneBoy
03-20-2009, 07:55 PM
So while it's possible in theory that a color input may block a vector type, one could always work around that case by pre-converting the vector to color (output type) with another node, I suppose.

Correct, that's the same maneuver that's used when connecting the regular color Mixer node into the Normal or Bump inputs. You just connect the Color output into a Vector Add (leaving input B zeroed out) then connect the Vector output into the Normal or Bump.

I did a quick check and it's possible to convert a Vector connection into a Color output using the ColorTool node. It has a color input but it doesn't reject Vector connections.

I could've written a node that would convert a Color connection to a Vector without the needless addition of 0.0 that the Vector Add does. But instead I chose to just re-implement the Mixer node using Vectors instead.

Psyhke
03-20-2009, 08:13 PM
Correct, that's the same maneuver that's used when connecting the regular color Mixer node into the Normal or Bump inputs. You just connect the Color output into a Vector Add (leaving input B zeroed out) then connect the Vector output into the Normal or Bump.

I did a quick check and it's possible to convert a Vector connection into a Color output using the ColorTool node. It has a color input but it doesn't reject Vector connections.

I could've written a node that would convert a Color connection to a Vector without the needless addition of 0.0 that the Vector Add does. But instead I chose to just re-implement the Mixer node using Vectors instead.

Good to know about the ColorTool node.

You know, I've always just stuck with bump/normal outputs. And sometimes DPonts bump-to-normal node. I'm wondering now, in cases where you want to try using a color-based node that doesn't have a native bump or normal output, if simply converting it using Add or the ColorTool will give an appropriate effect when using it to drive the bump/normal surface input. I'll have to do some experimentation.

DuneBoy
03-20-2009, 08:33 PM
Good to know about the ColorTool node.

You know, I've always just stuck with bump/normal outputs. And sometimes DPonts bump-to-normal node. I'm wondering now, in cases where you want to try using a color-based node that doesn't have a native bump or normal output, if simply converting it using Add or the ColorTool will give an appropriate effect when using it to drive the bump/normal surface input. I'll have to do some experimentation.

To use a regular color node output as a Bump or Normal input, it may need to go though some conversions. The Bump and Normal inputs are meant to be fed data that will tell LW how to shade the surface (the direction of the surface normals I believe).

In the layered system grayscale data could be used to bump the surface, but feeding black and white data into the Bump input won't give the same results.

If you load an image into an Image node then right click the node and change the Preview to Bump you can see the difference in the way the data looks.

DPont has a Scalar Bump node which can convert a scalar into the proper bump data. You can connect a color node into this node's Scalar input which in essence converts the color values to grayscale before making the translation to bump data.

Psyhke
03-20-2009, 10:47 PM
DPont has a Scalar Bump node which can convert a scalar into the proper bump data. You can connect a color node into this node's Scalar input which in essence converts the color values to grayscale before making the translation to bump data.

...and then the bump data into normal using his other node, if desired. So, the tools are all there to go from Color to Normal. Hmm. Sounds like another node: Color-to-Normal. :D

Also, the bump and normal inputs expecting directional data makes sense, and explains the need for the above nodes.

DuneBoy
04-08-2009, 09:39 PM
I've posted my Comp Layers node here:
http://www.lwplugindb.com/Plugin.aspx?id=48331837

A couple changes were made versus the unreleased version. It now supports 6 layers instead of 10, both the node and its panel were a bit too big with 10. Each layer now also has an envelopable Opacity control.

Psyhke
04-09-2009, 02:24 PM
Thanks. Taking it for a spin now!

Thomas Helzle
03-07-2013, 11:10 AM
DuneBoy: Was just looking for exactly that kind of node - thanks!

Works fine in 11.5 x64

Cheers,

Tom