Author Topic: Performance questions  (Read 2424 times)

Hello wonderful people at Allegorithmic - I have a couple node computation questions regarding performance of the final sbsar substance.

Example problem:
I have a door (metal) to texture, the client wants to have (optimistic version) 2 different metal types in the substance to switch. I can separate the default scratches and other weathering and put it in the graph as an instance. But what about the metal node chains ? Can they be instanced as well ? Or should I make different sbsar for each metal type - which will increase the total substances size as each sbsar needs to have normal map baked from high poly mesh.

1. How are the switch blend nodes evaluated ? The question is are the different node chains existing prior to the blend switch computed or not ? It looks like Substance Designer computes it all (eager evaluation). I wonder if the same substance published and used in Unity/UDK use different method (lazy evaluation) to check first for the default switches, and compute first only the needed node chains. When I'm creating simple node chains that give me only diffuse with mixed AO in them it matters little but what if I wanted to instance more complicated, lengthy graphs, each with it's own diffuse, normal, AO, etc. output.

2. Suppose I didn't put the metal node chains as instances put just pasted them into the graph. First noise generator used in the upper chain is the same as the noise generator used in the lower chain. Does it matter for the published substance if they are separate instances ? Or should they be collapsed to just one ? They both use the same exposed value/function.

3. If the sbsar in Unity/UDK is computing all nodes, I was thinking about putting a blend switch nodes (with UFC as 2nd input) just after each noise generator. They would be driven by the same exposed value as the main switch (most right). I don't know if the noises are computed or not in this case (ref question 1), but at least changing them to uniform color should speed up the computation of the rest of the chain. Or am I wrong ?

There is currently a bug in both Designer and the cooker that computes everything even though you put switches on your different graph branches.
It's been fixed and will be part of the 3.5 update for GDC (in a month). From that point, yes, using switches will allow you to discard dynamically some parts of the graph.

Also, if you have multiple instances of the same Noise or Generator with the exact same parameter set, it will calculate it only once.