2
\$\begingroup\$

I'm working on an iOS/Android project in Unity3D. We're seeing some incredibly long times for generating substances between testing runs. We can run the game, but once we shut down the playback, Unity begins to re-import all off the substances built using Substance Designer. As we've got a lot of these in our game, it's starting to lead to 5 minute delays between testing runs just to test a small change.

Any suggestions or parameters we should check that could possibly prevent Unity from needing to regenerate these substances every time? Shouldn't it be caching these things somewhere?

\$\endgroup\$
2
\$\begingroup\$

The substances by nature are generated at runtime. I have noticed a bit of lag sometimes myself, but from what I've noticed its only in the editor. A few tips to alleviate this check your substances you probably have a few that have some inefficient runtimes that could be causing a bottleneck. Also, if there are any substances that you are not generating variations, you don't need to have external seeds and can use a static number for in the substance itself.

\$\endgroup\$
1
\$\begingroup\$

Bake those substances

Substance painter is a very powerful tool, but it has downsides. I did...let's call it "unpaid work" for "an organization" that saw that the substance code was smaller (file size) than the baked texture files and thought it was an optimization because of fanciful notions about bandwidth and hosting. Six months later I joined and was tasked with figuring out why it took the game 30 minutes to change scenes (or start, as you're seeing).

They also wanted to use one material for everything because the artists wanted to do all of their work inside Unity rather than in substance painter just by fiddling with properties in the inspector. And wanted all of the tools substance painted offered.

Rather than exporting the material properties of your substance, bake it down into a texture or two. Also, you seem to be planning for mobile devices, where my advice is: don't use substance painter at all. Mobile devices do not have the cpu, gpu, and ram necessary to handle complex materials (heck, most mobile shaders don't even offer color multipliers). You need to think about batching, both static and dynamic and complex materials will almost certainly break batching. Especially if they are procedurally generated.

\$\endgroup\$

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.