Author Topic: Pixel Processor Optimization  (Read 690 times)

I was once told by a member of the Allegorithmic staff that all paths of a float / switch (if/else branches) are executed during a single run of the Pixel Processor, even if only one of the conditions are met. Is this true?

I've noticed that the random node is a good way to test these situations. The outcome changes if random is called twice per pixel instead of once, or three times instead of two, because random always outputs the same results if called in the same order, but doing this changes that order.

When I create several conditional branches, where only one is true, random does not seem to be executed for those branches. This makes me think these branches are actually *not* being executed. Unless Designer is internally prepared for such situations and compensates for it by "ignoring" the random calls.

I would like to know how the optimization works? Does the entire conditional branch get skipped (in a way that would make the number of sample calls irrelevant), or are the function nodes designed to internally skip execution when their branch should be ignored (where they still cost something even when not used)?

Can anyone straighten this out for me? If this is true, it dramatically changes the way I can go about designing graphs.

Thanks for any help!

Does anyone know the answer? Seems like knowing the answer to this question would dramatically change the way one would design a function graph.

I've been trying to keep mine simple due to the fear that non-executed function nodes may add performance cost. But if it doesn't, it would give us more room to provide extra user customization.