Issue

When using build machine (headless unity instance/batch mode) you may encounter behaviour where SDF Textures/Sprites is imported as just empty rectangles instead of proper SDF.

Expected result

image.png

Actual result

image.png

Why this is happening?

SDF generation backend using GPU to generate SDF textures, and unity in headless mode by default using -nographics argument.

How to fix?

After v1.3.x

<aside> ℹ️

Version 1.3.x introduced new Jobs-based CPU backend, SDF generation will now automatically fallback to using CPU when GPU is not accessible. If your build machine have access to GPU tho follow steps below, since generation on GPU is still faster.

Read more about more backends here: SDF Generation Backends

</aside>

Before v1.3.x

  1. Use build machine with access to GPU
  2. Remove -nographics argument. More about arguments HERE
  3. PROFIT