SeExpr scalars slower than just a raw number?


#1

Hello everyone,

I was recently using Fusion 9 and was learning their helpful ‘custom tool’ node, which i thought was very easy and helpful to use.

I was trying to find something similar in Natron and noticed the SeExprSimple node, which is really close to the fusion tool. (If not possibly built on the same standards?)

Anyways, while I was typing in some math in the R.G.B params I noticed that putting in numerical values there updated the viewer quickly, but swapping it out for an exposed scalar param in the same expression was much slower. Does this sound familiar to anyone? Maybe its a bug.

For example ((.05/.05^1.1)*r^1.1) is faster (when applying changes to the expression/values(variables)) compared to ((x2/x2^x1)*r^x1).

I tested this again using a simple pow of r^2, g^2, b^2 and swapping out the x1 with the exponent. Or simply changing the exponent number and then attempting the same thing by changing the value of the scalar variable. Results seem to suggest that exposing the variable and using that in the expression is much slower in general.

I had another question, if anyone had advice about a different method using the same expressions to get my results that would be very helpful. I attempted to learn expressions in Natron but keep getting stumped by the logic (I am not really a programmer), for instance I just want to take the input R,G,B from a node upstream and apply the math to it using user defined variables, much like I have in SeExprSimple.

My testing was using a simple ‘ramp’ node at a project size of 8192x4096.


#2

I was able to speed things up greatly by using variables from the SeExpr node as a way to set expressions in the Grade and Multiply node to complete the per channel formula. Still uncertain why piping it through that way produces results really fast while the SeExpr(Simple) nodes are really really slow.

My SeExpr has variables .001 / 1.1 / 1.2 / 1.4 / 1.6 (x1, x2, x3…) and I just ctrl+dragged those values into the ‘set expression’ dialogue of the Grade node and the Multiply node as a way to construct the same math that was simply done in the SeExpr node. The results are lightning fast in comparison this way, which seems a little strange.