1
$\begingroup$

I would like to do a little research, and I would like to simulate a MixRgb type node with a mathematical node, to mix BW type maps, since the MixRGB mixes 3 channels, it would be enough for me to mix only one (0-1 Bw), but I'm not sure how to test this with math, I tried the Math node "Multiply Add" I was curious to compare the performance between the RGB type and a node built with single value math, I did not find much about it by looking on the internet Example: (I would like to try to emulate, to compare the performances)

enter image description here

$\endgroup$
  • $\begingroup$ Is using a vector-math node acceptable for what you're trying to do? $\endgroup$ – Christopher Bennett Jun 13 at 17:46
  • $\begingroup$ I was trying to avoid using a 3 channel way, like RGB or XYZ (which seem the same thing after all) $\endgroup$ – Noob Cat Jun 13 at 18:34
2
$\begingroup$

This 'Mix Value' node group will emulate the simple Mix of two values:

enter image description here

  • The inputs are all clamped 0-1
  • The result is [(1-Fac) * Value 1] + [Fac * Value 2]

You can use this framework to test it:

enter image description here

The outputs of the Mix RGB node and of the combined lower branches, mixing the channels independently, are indistinguishable.

If you want to test the other mix modes, this reference could be handy.You would replace the 'Add' in the node group with the functions described. here's a link to the Blender code, thanks to this answer by @Meng Hui Tan.

Have fun!

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Oops , I left a crazy Fac value in the input node after testing.. I was making sure noithing went out of range in the result.. $\endgroup$ – Robin Betts Jun 13 at 20:05
  • $\begingroup$ Very interesting, I am doing tests to understand the consumption of resources in comparison with the mixrgb node as regards only black and white, therefore single-value maps. But I don't understand if there is a difference in performance. We should try on big scenes $\endgroup$ – Noob Cat Jun 14 at 5:50
  • 1
    $\begingroup$ I don't know.. I suspect not much difference, since in all the renderer's heavy-lifting areas, the contribution of rays will be evaluated in full RGB? I don't think the renderers can be forced into a monochrome mode.. i think the single channel can only be obtained by extraction from a full-color render. maybe someone who knows will come along. $\endgroup$ – Robin Betts Jun 14 at 7:21
  • $\begingroup$ Your reasoning seems correct, I look forward to someone who may be able to explain the situation better. Your answer enlightened me $\endgroup$ – Noob Cat Jun 14 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.