Refraction
Refraction is a screen-space UV offset for refracting the background pixels. Make sure you set the alpha to something below 1 before using, so that the refraction effect is visible.
这是SF官方给出的折射节点的说明。
在生成的shader中对折射节点进行跟踪,使用的shader如下
// Shader created with Shader Forge v1.35
// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
//对Shader Forge 内置折射节点的研究
//使用了一个名为Test的Color属性来确定SF如何使用节点的输入数据,此种用法并不正确
Shader "Shader Forge/Default_Refraction"
{
Properties
{
_Alpha ("Alpha", Range(0, 1)) = 0.5
_Test ("Test", Color) = (0,0,0,1)
}
SubShader
{
Tags
{
"IgnoreProjector"="True"
"Queue"="Transparent"
"RenderType"="Transparent"
}
GrabPass{ }//SF生成的代码使用了无参数的GrabPass来进行抓屏处理
Pass
{
Name "FORWARD"
Tags
{