位置: 编程技术 - 正文
推荐整理分享Unity3D开发之Unity5版本自写Shader没有雾的效果问题(unity3d官方教程),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:unity3d 开发,unity3d开发之对象池,u3d unity3d,unity3d documentation,unity3ds,unity3d官方教程,unity3d documentation,unity3d documentation,内容如对您有帮助,希望把文章链接给更多的朋友!
原本项目是Unity 4.6版本的,升级到Unity 5之后发现原本的雾不再看见了,然后查了一下相关资料,发现官方是改变了雾的渲染。
这里有相关的官方方式:
surface shaders, nothing needs to be done; fog variants & code will be generated. You can add "nofog" to #pragma surface line, if you really don't want fog.For vertex/fragment shaders, if you want fog you have to do this:Add #pragma multi_compile_fogAdd UNITY_FOG_COORDS(n) to your vertex-to-fragment structAdd UNITY_TRANSFER_FOG(o,o.vertex); to your vertex shader. "o" is output struct name, and "o.vertex" is position in clip space.Add UNITY_APPLY_FOG(i.fogCoord, col); to end of your pixel shader. "i" is input struct name, and "col" is the color computed in your pixel shader. This applies standard fog color; if you want custom fog color (as some particle/additive shaders do, for example), you can do UNITY_APPLY_FOG_COLOR(i.fogCoord, col, fixed4(0,0,0,0)); to fog towards black for example.For fixed function shaders, nothing needs to be done. "Fog { ... }" command in shaderlab still works, but now it onlyaffects fixed function shaders (for non-fixed function, see point 2 above).By default, fog modes used by scenes are included into game data build. If you know you'll want to change them at runtime, you can choose "Custom fog modes" (default is "automatic") under project's Graphics Settings, and tick checkboxes you need.
Unity3D制作2D精灵动画 首先导入图片,我自己做了个简单的图片。图片导入unity3d,修改spritemodel,点击spriteeditor。如果,图片中的各个元素距离比较开,可以用Slice自动划分。
Unity3D教程宝典之Shader篇 基本知识 基础讲:基本知识以下内容不需要入门的时候立刻阅读和理解,建议逐渐深入学习后,不时回来看看即可。什么事GUP?GUP:GraphicProcessingUnit,中文翻译为
unity商店demo学习:俯视视角RPG游戏 一下所有素材和源码都来自unity商店的实例Top-DownRPGStarterKit,这个demo是unity商店上最好的入门级rpg游戏实例,麻雀虽小,五脏俱全,想要弄清楚一个标准
标签: unity3d官方教程
本文链接地址:https://www.jiuchutong.com/biancheng/372803.html 转载请保留说明!上一篇:【边玩边学Unity3d】实现可编辑网格(unity3drpg游戏教程)
下一篇:Unity3D制作2D精灵动画(unity精灵编辑器)
友情链接: 武汉网站建设