Unity3D打包Assetbundle丢失Shader问题

这篇具有很好参考价值的文章主要介绍了Unity3D打包Assetbundle丢失Shader问题。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

详情见:https://www.pianshen.com/article/5391338163/

1、Unity3D在打包Assetbundle时,可能会遇到Shader丢失的问题,解决方法:打开Edit->Project Settings->Graphics,在Always Included Shaders列表添加上所需的shader,再打包即可。

Unity3D打包Assetbundle丢失Shader问题

2、参考

Unity3D打包Assetbundle丢失Shader问题

3、原文复制

Graphics Settings

Unity3D打包Assetbundle丢失Shader问题

Scriptable RenderLoop settings

This is an experimental setting which allows you to define a series of commands to control exactly how the Scene should be rendered (instead of using the default rendering pipeline used by Unity). For more information on this experimental feature, see the Scriptable Render Pipeline documentation on GitHub.

这是一个实验设置,允许您定义一系列命令来精确控制场景的渲染方式(而不是使用Unity使用的默认渲染管道)。有关此实验功能的详细信息,请参见GitHub上的可脚本呈现管道文档。可编程渲染管线

Camera settings

These properties control various rendering settings.

这些属性控制各种渲染设置。

Setting:

Description:

Transparancy Sort Mode

透明性排序模式

Renderers in Unity are sorted by several criteria such as their layer number, or their distance from camera. Transparency Sort Mode adds the ability to order renderable objects by their distance along a specific axis. This is generally only useful in 2D development; for example, sorting Sprites by height or along the Y axis.

Unity 中的渲染器按几个标准排序,例如层号或与摄影机的距离。透明度排序模式增加了按可渲染对象沿特定轴的距离排序的功能。这通常只在二维开发中有用;例如,按高度或沿Y轴对精灵排序

Default

Sorts objects based on the Camera mode.

Perspective

Sorts objects based on perspective view.

Orthographic

Sorts objects based on orthographic view.

Transparancy Sort Axis

Use this to set a custom Transparency Sort Mode.

Tier settings

These settings allow you to make platform-specific adjustments to rendering and shader compilation, by tweaking builtin defines. For example, you can use this to enable Cascaded Shadows on high-tier iOS devices, but to disable them on low-tier devices to improve performance. Tiers are defined by Rendering.GraphicsTier.

这些设置允许您通过调整内置定义对渲染和着色器编译进行特定于平台的调整。例如,您可以使用它在高层iOS设备上启用级联阴影,但在底层设备上禁用它们以提高性能。层由rendering.graphictier定义。

Built-in shader settings内置的shader设置

These settings allow you to specify which shader is used to do lighting pass calculations in deferred shading and legacy deferred lighting rendering paths, respectively.

这些设置允许你指定在deferred shading(Deferred Shading是现在比较流行实时渲染方式,这种渲染方式能把Geometry和Lighting之间的耦合解开,把Forward Shading的Geometry Pass*Lighting Pass复杂度下降为Geometry Pass+Lighting Pass,特别适合于渲染较多动态光源的场景)和legacy deferred lighting中哪些shader被用于光照通道的计算。

Setting:设置

Description:描述

Built-in shader(Default value)

Use Unity’s built-in shaders to do the calculation.

Custom shader定制shader

Use your own compatible shader to do the calculation. This enables you to do deep customization of deferred rendering.用你自己的兼容的shader用于计算。这样你就可以深度定制 deferred rendering。

No Support不支持

Disable this calculation. Use this setting if you are not using deferred shading or lighting. This will save some space in the built game data files.关闭计算。如果你没有使用 deferred shading或者 lighting。这将会节省你构建游戏数据文件的空间。

Always-included Shaders一直包括的shader

Specify a list of Shaders that will always be stored along with the project, even if nothing in your scenes actually uses them. It is important to add shaders used by streamed AssetBundles to this list to ensure they can be accessed.

指定一个将会一直存在工程中的shader列表,即使你的场景中没有任何东西使用它们。对于assetbundlle中用到的 shader 把他们加到这个list中非常重要,可以防止shader丢失。 (当需要导出的资源中使用的是内置的shader的时候需要注意这个)

Shader strippingshader剥离(根据当前打开场景的光照贴图模式和雾的模式把导出的shader中没有用到的shader variants剔除掉不导出,可能导致光照丢失和雾丢失的问题

Lower your build data size and improve loading times by stripping out certain shaders involved with lighting and fog.降低打包的数据大小和通过剥离光照和雾中涉及的特定的shader提高加载的速度。

Setting:

Description:

Automatic(Default value)自动

Unity looks at your scenes and lightmapping settings to figure out which fog and lightmapping modes are not in use, and skips corresponding shader variants.unity查看你的场景和光照贴图的设置来知道哪些雾和光照贴图的模式没有用到,然后剥离相关的shader variants.

Manual手动

Specify which modes to use yourself. Select this if you are building asset bundles or changing fog modes from a script at runtime, to ensure that the modes you want to use are included.指定哪些模式你用到了。如果你导出assetbundle或者会用脚本在运行时修改模式,来确保你将要用到的模型被包括了。

Shader preloading shader预加载

Specify a list of shader variant collection assets to preload while loading the game. See Optimizing Shader Load Time page for details.文章来源地址https://www.toymoban.com/news/detail-421054.html

到了这里,关于Unity3D打包Assetbundle丢失Shader问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Unity3d 图片Image置灰shader

    置灰公式:    value=color.r x 0.299 +color.g x 0.587 + color.b * 0.114 color.rgb = lerp(color.rgb, Luminance(color.rgb), _Factor); 或 color.rgb = dot(color.rgb, fixed3(0.299, 0.587, 0.114));

    2024年02月11日
    浏览(31)
  • Unity3D Shader系列之深度纹理

    这篇总结下场景扫描的效果。场景扫描背后的原理其实挺简单,先获取相机的深度图,再获取相机绘制的画面,然后从深度图中取出当前像素的深度值,如果深度值在我们扫描线的深度值的范围内,那么当前像素的颜色就为扫描线的颜色与原画面颜色的叠加。所以实现这个效

    2023年04月11日
    浏览(26)
  • Unity3D Shader 引导遮罩,支持圆形、矩形、圆角矩形框

    unity3D新手引导遮罩,支持圆形,矩形框,圆角矩形框。图形位置和大小可以根据控件的位置和大小调节,通用所有分辨率设备。黄色区域遮挡,只有白色区域可以点穿。 原文链接:https://www.kadastudio.cn/archives/89 ​ 将MyGuideMask挂载到脚本上,然后通过GuideMask创建材质并赋值,根据

    2024年02月11日
    浏览(40)
  • Unity引擎打包AssetBundle后模型网格数据丢失问题

    大家好,我是阿赵。 在项目里面,有时候会遇到这样一个问题。在Unity编辑器里面编写了一个shader,在编辑器看,效果都是没有问题的。但如果把资源打包成AssetBundle后,会发现shader的表现不对了。遇到了这种问题的时候,一般人会各自的怀疑,怀疑是不是shader写得不对,导

    2024年02月07日
    浏览(34)
  • Unity打包错误:无法成功进行Unity3D应用程序打包

    在Unity开发过程中,有时候会遇到各种各样的错误。其中一个常见的问题是无法成功进行Unity3D应用程序的打包。本文将探讨可能导致此错误的几种常见情况,并提供相应的解决方案。 资源文件丢失或路径错误: 打包应用程序时,确保所有所需的资源文件都存在,并且路径设

    2024年01月16日
    浏览(33)
  • Unity3D PC、Android、iOS平台打包流程

    在Unity窗口中,按下Ctrl+Shift+B快捷键,或者在菜单栏选择File-BuildSettings...,打开设置窗口。“Platform”下的选择项默认选择“Windows,Mac,Linux”。单击左下方的“Player Settings...”继续后续设置(应用名、应用分辨率、图标等),如图1-1所示。 图1-1 PC平台选择 接着,点击Add Op

    2023年04月20日
    浏览(45)
  • 如何将Unity3D中的脚本打包成为DLL类库?

    如果我们想把代码打成DLL,首先需要有一个Assembly和一个合理的代码目录结构规划。 1.将要归为一类的脚本放进同一个文件内,在该文件夹下右键创建一个Assembly Definition,默认它会将同文件夹以及子目录内的脚本归为一个Assembly。 2.在Editor下创建一个CompileDll脚本来将我们的脚

    2024年02月12日
    浏览(32)
  • 【虚拟仿真】Unity3D打包WEBGL后播放视频(VideoPlayer组件)

    推荐阅读 CSDN主页 GitHub开源地址 Unity3D插件分享 简书地址 我的个人博客 大家好,我是佛系工程师 ☆恬静的小魔龙☆ ,不定时更新Unity开发技巧,觉得有用记得一键三连哦。 本篇文章实现Unity3D打包WEBGL后播放视频,如下图所示: 使用了VideoPlayer组件,代码比较简单。 主要就

    2023年04月25日
    浏览(45)
  • Unity3D中打包WEBGL后读取本地文件数据+网络请求

    首先上一编博主运行html之后报的错误:提示内存不足!!!! 1.首先排查一下webgl包的大小,不能超过2G。 2.F12查看具体错误,在这里博主的是:        a:本地读取StreamingAssets里的配置文件,序列化失败。        b:网络请求方法不能使用JsonConvert.SerializeObject将对象重新序列

    2024年02月08日
    浏览(41)
  • Unity3d发布android项目,打包apk包流程(unity2021.3.10)

    1、如下图,在安装版本设置里,点击添加模块。如果没有添加模块,证明你安装路径不是目前版本的安装路径,先去设置回来。 2、框选Android Build Support,点击继续,如下图, 3、同意,安装,如下图, 4、等待安装完成即可,如下图。 1、点击菜单栏File→Build Settings,进行编辑

    2023年04月23日
    浏览(40)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包