Unity ShaderGraph菲涅尔效果案例
前言
好好学习,天天向上。
视频链接: https://www.youtube.com/watch?v=Ar9eIn4z6XE
最终效果
制作过程
创建菲涅尔效果
并且制作一个控制Power
的节点,暴露在外界方便调整。
将菲涅尔效果与颜色相乘
与颜色相乘得到一个渐变色的菲涅尔效果。
制作一个来回波动的数字
使用Sin(Time)
曲线控制时间从-1到1来回变化,使用Remap
重新映射数值范围到0.2-1之间。
自动控制菲涅尔效果的强度
使用之前制作的带颜色的菲涅尔效果与来回变动的变量相乘,得到菲涅尔强度变化的效果。
增加遮挡贴图
The occlusion map is used to provide information about which areas of the model should receive high or low indirect lighting. Indirect lighting comes from ambient lighting and reflections, and so steep concave parts of your model such as a crack or fold would not realistically receive much indirect light.
遮挡图用于提供关于模型的哪些区域应该接收高或低的间接光照的信息。间接照明来自环境照明和反射,因此你的模型的陡峭凹面部分,如裂缝或褶皱,实际上不会接收到太多的间接照明。
遮挡贴图是一个Texture2D类型的,需要转换成单通道值,使用SampleTexture2D
进行转换,置入Occlusion
中。