前言
Unity2021.3.23
一、实现原理
Time控制UV的变化,再采样一张流光贴图.即可实现流光效果。
二、效果及源码展示
1.流光效果
效果描述:
1.边缘光(菲尼尔),
2.从上到下扫描光.
效果图如下:
代码如下:
Shader "Unlit/ScanCode"
{Properties{_MainTex ("Texture", 2D) = "white" {}_RimMin("RimMin",Range(-1,1)) = 0.0_RimMax("RimMax",Range(0,2)) = 1.0_InnerColor("InnerColor",Color) = (0.0, 0.0, 0.0 ,0.0)_RimColor("Rim Color", Color) = (1,1,1,1)_RimIntensity("Rim Intensity", Float) = 1.0_FlowTilling("Flow Tilling",Vector) = (1,1,0,0)_FlowSpeed("Flow Speed", Vector)= (1,1,0,0)_Fl