I have a what I would describe as a rather complex sequence of operators. However their computation is not needed for the entire duration of the effect. Can I somehow branch them with a if so that the actual computation does not happen unless a bool is true? Here are the operator blocks in question.
Hello ! I don’t know exactly what your sequence is doing but maybe something like this should work :
In true you put your computation, and in false your default value. You can have more complex condition with the logic operators.
Hey thanks for replying. I’m aware of the branch operator, but as far as I know this wont stop the computation from happening. It will still compute both values for true and false and just pass one down the line depending on the bool. What I want is more like what we would do in code like :
if(condition)
{
//Do computation
}
else
{
//Do something else
}
Oh so it’s only for optimisation purpose ? in this case i don’t know. The only thing that come to my mind is doing all your computation via script and returning the value you need through an exposed property.
Unless there is anything special I have no clue about, as all of these are shaders it’s up to compiler if it’s branch or not. If there is huge block of computations it might end up as branch.