Is it ok to use "#pragma target 3.0" in shader for mobile game?

My game is for mobile devices and phones.
And I need 10 interpolators, so I should use target 3.0.

In Unity manual, target 3.0 is described like this.

#pragma target 3.0

  • DX9 shader model 3.0: derivative instructions, texture LOD sampling, 10 interpolators, more math/texture instructions allowed.
  • Not supported on DX11 feature level 9.x GPUs (e.g. most Windows Phone devices).
  • Might not be fully supported by some OpenGL ES 2.0 devices, depending on driver extensions present and features used.

But, I don’t know it’s okay to use this define in mobile games.
Is there any device coverage information?
I don’t want to make my game for just small high performance devices.

It’s hard to say… Shader model version are for DirectX only. OpenGL doesn’t use that.
As is it said, depending on what feature you use from shader model 3.0, it may work, or it may not.

Are you able to try your shader on a low cost android device or an old android phone like the Galaxy S3 ?

iPad/iPhone technically can support almost all of shader model 3.0 features. And the features should work on most “not so old” android device.

So, i think it is safe to set SM3.

1 Like

Well, the manual is pretty clear.

You can use it. It might cause issues with some Opengl ES 2.0 devices.