Author Topic: Shader Control Keyword Error but under limit?  (Read 1356 times)

fairchild671

  • Newbie
  • *
  • Posts: 15
    • View Profile
Shader Control Keyword Error but under limit?
« on: December 12, 2016, 06:23:44 PM »
Hello there! Shader Control has been absolutely fantastic however I may have run into a minor issue. That or I may not be using the tool properly?

Basically when Shader Control appears to show that less than 128 keywords are being used (for Unity 5.4.2p4) I sometimes still get shader keyword errors?

Here's a recent example (apologies for the large image):



Sometimes a different keyword will show up in that error message, or even more than one might show up. It all depends on if I've restarted Unity or not. However in Shader Control it always displays 125 of 168 keyboards as being used. Is that correct? Apologies if this is not the correct forum section for this.

Thanks!

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4329
    • View Profile
Re: Shader Control Keyword Error but under limit?
« Reply #1 on: December 12, 2016, 11:20:31 PM »
Hi!
Please update to latest version of ShaderControl which also supports shader_features keywords and make sure you click "Clean All Materials".
Let me know if this helps.
Regards.

fairchild671

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Shader Control Keyword Error but under limit?
« Reply #2 on: December 13, 2016, 09:49:24 AM »
Thanks, I've updated to version 1.2 from the Asset Store and immediately noticed it displayed more used shader keywords than the previous version.

I still managed to reduce the keywords down to 110 and "Cleaned All Materials" but I still get the same errors (even after restarting Unity):



Not sure if it helps any but it looks like the newer SC version has revealed more shaders from the Relief Terrain Pack asset that were not visible in the previous SC version. I was just trying to compare the differences.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4329
    • View Profile
Re: Shader Control Keyword Error but under limit?
« Reply #3 on: December 13, 2016, 01:21:02 PM »
Well, version 1.2 shows all shaders that expose keywords at project level - so all keywords should be there on that list.

Is it possible that you send me a pm with a download package including all your shaders and materials in the project? You can remove anything else. I'll gladly check those materials for any rogue keyword and get back to you. Thanks!

transat

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Shader Control Keyword Error but under limit?
« Reply #4 on: December 12, 2018, 01:14:01 AM »
I'm having a similar problem with 2018.3.0f1 and Shader Control 3.1. But this time with the 256 keyword limit...


Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4329
    • View Profile
Re: Shader Control Keyword Error but under limit?
« Reply #5 on: December 14, 2018, 08:44:37 AM »
Shader Control by default only scan shaders that can be modified and are located within a Resources path. To fully scan all available shaders make sure the checkbox “Force Scan All Shaders” is enabled.
 
Note that compiled shaders (like internal Unity shaders) does not provide source code or engine-level keywords (like INSTANCING_ON) are not reachable, so those keywords cannot be deactivated hence Shader Control won’t show them or can’t know about them as they are injected at compile time but are not available in Editor time.

Because of that, you may exceed the 256 keword limit even if Shader Control reports a lower value. Still the keywords that Shader Control provides are the only ones that you can disable so try to reduce those even more until you eventually get under the 256 limit.