https://bitbucket.org/ArtIsDarkGames/shader-keywords-tool-unity3d/src/master/

https://eternity429.wordpress.com/2017/12/06/unity-shader-variant-system%E6%BD%9B%E8%97%8F%E9%9A%B1%E6%86%82/

其中,multi_compile 及 shader_feature都是定義keyword的功能,但其Build情況有所不同。

  • shader_feature會根據專案內是否有同時使用到此keyword啟動、非啟動的狀態生成對應Variant,適合無須在Runtime中變動、僅需要在Editor中設定好的功能。
  • multi_compile則會無論有無實際啟動keyword與否都會生成Variant。
    如果你的keyword功能會在Runtime中動態切換,那麼需使用此項。

-------------------------------------------------------------------------------------------------------------------------

一般大多數情況都是使用shader_feature足矣,你可以在編輯器中選中Shader來觀察該Shader會實際產生多少個Variant。

整个unity里面的shader的#pragma multi xxxxx_ON 关键字不能超过256个,给系统添加负担。
所以会报错:maximum number (256) of shader keywords exceeded unity。
做法是减少关键字的使用。

好像是说在u3d 2019 beta4后面用window>package manager>安装LightWeight render-pipelines,就能解决toggleui不再产生关键字的问题?

下面提供一个优化工具。这个工具只是检查,而具体优化还是要靠手动,就是toggle的方式最多只能又256个。

使用方法:
重点!是先备份你的工作,然后把这个工具拷贝到你的项目 Assets文件夹。
从这个ShaderKeywordsTool文件目录拖拽 the ShaderKeywordsTool预制体到场景里。
把ShaderKeywordsTool.cs套到预制体上。
选择并点击这个绿色按钮 'Scan project for Shader Keywords’。
你点击这个‘Show Shader’按钮 ,它将给你在项目窗口做些shader。
你能够高亮显示shaders 统计keywords关键字 used between shaders
点击按钮‘More Info’ button 将显示发现的shader的关键字的路径。
删除没用的shaders。
重新扫描项目按钮 - 'Scan project for Shader Keywords’
点击这个红色按钮, 工具将自动搜索所有的 materials并且移除这些关键字 keywords that are now longer used 在项目里, 确保你已经备份了你的项目先。
在unity的Edit/Project Settings/Graphics 点击在‘Currently tracked’旁边的clear按钮。
重启项目。

How to use

IMPORTANT back up your work, this tool will alter your materials and is cannot be undone! copy the ShaderKeywordsTool folder to your Assets folder
drag the ShaderKeywordsTool prefab from the ShaderKeywordsTool folder onto the stage
select it and click the green button 'Scan project for Shader Keywords’
You can click on the ‘Show Shader’ and it will take you to the shader in the project window
You can highlight multiple shaders to count the keywords used between shaders
Clicking the ‘More Info’ button will show the path to the shader and keywords found
Delete unused shaders.
Rescan project - 'Scan project for Shader Keywords’
Click the red button, tool will automatically search all materials and remove the keywords that are now longer used in the project, make sure you have backed up your project
In unity goto Edit/Project Settings/Graphics and click on the clear button at the bottom near ‘Currently tracked’
Restart project
I have used this on a big project with around 3500 Materials and found it really useful. I hope you find this tool useful also

Taz Cebula - Art Is Dark

maximum number (256) of shader keywords exceeded unity的报错解决方法相关推荐

  1. [Unity]ShaderGraph问题所有材质丢失Maximum number (256) of shader keywords exceeded

    2018.2.18f个人64位 Maximum number (256) of shader keywords exceeded 可能需要删除一些shader 把Edit- ProjectSettin ...

  2. requests.exceptions.SSLError: HTTPSConnectionPool Max retries exceeded with url 报错解决方法

    import requests import jsonheaders = {"Content-Type": "application/json"} url = ...

  3. ORA-00020: maximum number of processes (xxxx) exceeded 报错解决方法

    ORA-00020: maximum number of processes (xxxx) exceeded 报错解决方法 参考文章: (1)ORA-00020: maximum number of ...

  4. Unity报错解决方法

    一.导入package报错:"Failed to import package with error: Couldn't decompress package" 可能的原因: pa ...

  5. Java-The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx

    一.异常日志: 2022-07-04 15:37:52,255 ERROR [http-nio-9202-exec-4] [frond-tmc,,,true] [ExportExcelMoreShee ...

  6. Failed to connect to database. Maximum number of connections to instance exceeded

    使用ArcGIS Desktop连接sde,提示Failed to connect to database. Maximum number of conections to instance exce ...

  7. The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook

    The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook ...

  8. LaTeX报错解决办法:arithmetic: number too big ! Dimension too large.

    LaTeX报错解决办法:arithmetic: number too big ! Dimension too large. 试了一些网上搜到的办法: 用画图软件.PS之类的修改另存jpg或者png: ...

  9. QuotaExceededError the quota has been exceeded --- Firefox 报错解决

    QuotaExceededError the quota has been exceeded - Firefox 报错解决 Firefox 报错 : QuotaExceededError the qu ...

最新文章

  1. phpcmsv9多表联合查询分页功能实现
  2. python把列表写入excel_用Python将列表写入Excel文件
  3. React开发(148):componentWillReceiveProps
  4. vue中使用cookies和crypto-js实现记住密码和加密
  5. c语言的c语句ab2,当初我在重庆交通大学读书的时候C语言成绩也相当不错的
  6. MacFetionV0.8.0测试版
  7. 为什么 Netflix “永不宕机”?
  8. python基础知识培训价格_Python基础知识的学习
  9. (一)Quartz2.2.1 简单例子
  10. OpenCV-图像处理(29、凸包-Convex Hull)
  11. Opencv椭圆拟合
  12. 我是如何用百度知道做小众企业站流量推广的?
  13. 2021 年最佳开源软件榜单
  14. 软件测试中学生选课用例表,软件测试选课系统测试用例(新).xls
  15. 服务器装系统怎样进bios设置,重装系统怎么进入bios设置界面?进入bios设置界面详细教程!...
  16. 奥塔哥大学计算机科学怎样,奥塔哥大学自然科学学院挂科率高吗?
  17. 使用腾讯云Ubuntu20.04搭建代理服务器
  18. 使用Datadog在docker环境下监控Java, Tomcat, Nginx, Kfaka, ZooKeeper
  19. android微信炸弹代码,微信炸一炸怎么弄安卓?拍一拍炸一炸会动炸弹设置教程...
  20. java与nodejs区别_nodejs和java之间有什么区别?

热门文章

  1. fm调制matlab仿真,matlab fm调制仿真.doc
  2. python物联网通信_python 物联网
  3. SysFader. IEXPLORE.EXE-应用程序错误解决方法
  4. DAVINCI DM3730开发攻略——序
  5. 全国个别城市ID代码
  6. 快用Python(Pygame)代码燃放起你专属的烟花吧,咝......咻——嘭~
  7. java控件数组_java通过复选框控件数组实现添加多个复选框控件
  8. 目前世界上最好的卫星地图查看站 Atlas 提供更好的地图
  9. 使用R语言进行股票价格预测
  10. 自己制作优化大师(win32 SDK)