unity如何设置fog,shader如何接收fog
2017-05-08 10:42
489 查看
设置fog,在WIndow->Lighting,Scene签页的Fog项勾选上,设置FogColor,Mode(The options are Linear, Exponential and Exponential Squared (these are in increasing order of fog accumulation with distance).
shader接收fog,需要添加以下几句:
v2f加:#ifndef LIGHTMAP_OFF
half2 uvLM : TEXCOORD5;
#endif
UNITY_FOG_COORDS(6)
vert加:
UNITY_TRANSFER_FOG(o,o.pos);
frag加:
UNITY_APPLY_FOG(i.fogCoord, finalRGB);
shader接收fog,需要添加以下几句:
pragma multi_compile_fog
a2v加:float2 texcoord1 : TEXCOORD1;v2f加:#ifndef LIGHTMAP_OFF
half2 uvLM : TEXCOORD5;
#endif
UNITY_FOG_COORDS(6)
vert加:
UNITY_TRANSFER_FOG(o,o.pos);
frag加:
UNITY_APPLY_FOG(i.fogCoord, finalRGB);
相关文章推荐
- winsock编程如何设置发送与接收超时参数?
- js_前台页面如何设置radio、checkbox、select三者的值以及绑定事件,方便后台接收数据
- Python发邮件如何设置多人接收
- 【Unity】如何对公共INT类型数字快速设置
- Unity的Shader如何控制投影颜色
- [mentalray]如何在Maya.env里设置shader_p的路径
- Unity发布android时图片如何设置
- 如何系统的学习 Unity 3D 中的 shader 编写nvidia cg 编程
- 如何在Unity 3D中设置Google AdMod
- 【Unity&DragonBones&骨骼动画】DB骨骼动画如何开启缓存设置
- Outlook接收hotmail邮件如何设置
- 如何获取/设置socket对应的内核缓冲区(发送,接收)的大小
- Unity中Shader代码在vs2010中关键字高亮的设置
- [Unity技巧]unity中使用visual studio编写shader并设置代码高亮
- Unity Shader 学习笔记 (七) 根据切线和法线方向设置模型颜色shader
- Mac版Outlook如何设置自动接收邮件时间
- 如何设置Unity的脚本编辑器为VS
- Unity 5如何设置物体透明
- Unity Shader Example 19 (fog)
- 【Unity Shader】如何修改LineRenderer与TrailRenderer 中的颜色