Can't permanently turn off #pragma only_renderers

behealed 5 months ago • updated by nickolas.g.russell 2 months ago 2

If you uncheck all the options for Target Renderers in the shader settings, it compiles successfully without adding the #pragma only_renderers line to your shader code. That's great.

However, if you then open the shader again in shader forge, it changes your settings and adds a checkmark (without asking me) to the following options:

  • Direct3D 9
  • Direct3D 11 & 12
  • OpenGL Core
  • Open GL ES 2.0

Please fix this so that it does not automatically modify my shader settings. 

Again, just to be clear, it is automatically adding a checkmark to those 4 options without asking me.

Noticing this also. I'm building to lots of platforms and it's easier to not use #pragma only_renderers at all. So I have to remember to disable those four renderers every time I make a change to a shader in ShaderForge.

It also gives a very misleading error 

"Your shader might not render properly on your workstation - you need to have Direct3D 11 enabled when working in DX11 mode on Windows. Click the icon to enable Direct3D 11!"

ALL renderers are enabled by default if exclude_renderers and only_renderers are not being used, that warning should only show if other renderers are explicity checked and Direct3D11 is not checked.

Unity recommended use for these target renderers anyway is when using platform specific shader technology. I am not so is there any benefit to building to fewer renderers? Does it save build time? when does the shader get built?