0
\$\begingroup\$

I've just designed an image-based layering system shader. Multiple textures with Alphas overlay to create a fully dressed character, using 1 material.

pragma target 3.0 is where I had started (suggested default in UnityProjects).

After creating so many transparent-overlay layers in my code, I got this:

Shader error in 'Custom/Test': Too many texture interpolators would be used for ForwardBase pass (12 out of max 10)

The fix seems to be to upgrade to #pragma target 3.5

My game is going to be a Steam-distributed game, PC only.

What do I lose by using #pragma target 3.5? Will only super-dvanced PCs be compatible? Or should a fairly good/average PC be able to run this?

I don't know the intricacies of this subject.

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

This seems to be explained in the Unity documentation:

  • #pragma target 3.5 (or es3.0) OpenGL ES 3.0 capabilities (DX10 SM4.0 on D3D platforms, just without geometry shaders).

  • Not supported on DX11 9.x (WinPhone), OpenGL ES 2.0.

  • Supported on DX11+, OpenGL 3.2+, OpenGL ES 3+, Metal, Vulkan, PS4/XB1 consoles.

  • Native integer operations in shaders, texture arrays and so on.

Comparing this to the numbers from the Steam hardware survey for May 2020:

OVERALL DISTRIBUTION OF CARDS...MAY

  • DirectX 12 92.02%

  • DirectX 11 3.99%

  • DirectX 10 2.23%

  • DirectX 9 Shader Model 2b and 3.0 0.04%

  • DirectX 9 Shader Model 2.0 0.00%

  • DirectX 8 GPUs and below 1.72%

So it looks like you'd exclude less than 2% of the Steam audience by using #pragma target 3.5.

\$\endgroup\$
3
  • \$\begingroup\$ Thats a great answer. I didn't know about the steam data you've dug up, so thank you very much. \$\endgroup\$ – Leo Blanchette Jun 15 '20 at 1:09
  • \$\begingroup\$ Hahaha, if this is a free-to-play game, maybe I'd exclude more since my audience might be people who can't afford better hardware. :D So that 2% might be the audience. \$\endgroup\$ – Leo Blanchette Jun 15 '20 at 1:11
  • 1
    \$\begingroup\$ That's a question you'll answer only through market research, not via StackExchange 😉 \$\endgroup\$ – DMGregory Jun 15 '20 at 1:14

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.