// author : Saber
|
|
// date : 2020/12/2
|
|
// desc : 本着色器的目的是整合项目中已有的【模型用透明通道特效】,会保留原先shader的全部参数以及实现
|
|
// 旨在减少多个材质对同一模型顶点和面片的多次处理,整合特效shader效果
|
|
|
|
// CombineModelEffectFull:拥有两种UVRoll效果(双效果纹理)以及两种Scan效果(单纹理双效果四通道)
|
|
Shader "SaberShad/CombineModelEffectFull"
|
|
{
|
|
Properties
|
|
{
|
|
// 被整合的shader参数逐条对应,为了方面识进行了适当的改名
|
|
// 整合uvrolladd_noise_mask效果 (文件名 sy_uvrolladd_noise_mask.shader)
|
|
_UVRollTex ("UVRoll Tex", 2D) = "white" {}
|
|
// 额外支持第二种UVRoll纹理
|
|
_UVRollTex2 ("UVRoll Tex2", 2D) = "white" {}
|
|
|
|
_UVRollColor1 ("UVRoll Color1", Color) = (1, 1, 1, 1)
|
|
_UVRollColor2 ("UVRoll Color2", Color) = (1, 1, 1, 0)
|
|
_UVRollSpeed ("UVRollSpeed", Vector) = (0, 0, 0, 0)
|
|
_UVRollIntensity1 ("UVRoll Intensity1", Range(0, 20)) = 1.5
|
|
_UVRollIntensity2 ("UVRoll Intensity2", Range(0, 20)) = 1.5
|
|
|
|
_UVRollNoiseTex ("UVRollNoise", 2D) = "white" {}
|
|
_UVRollNoiseSpeed ("UVRollNoiseSpeed", Vector) = (0, 0, 0, 0)
|
|
_UVRollNoiseIntensity("UVRollNoise Intensity", Range(-10, 10)) = 0
|
|
|
|
// 整合了uvroll效果和scan效果的mask为一张通道纹理,去除通道纹理的细节
|
|
// 本shader最多支持两种不同的uvrolladd_noise_mask,分别占用贴图的R和G通道(BA给Scan效果)
|
|
_EffectMaskTex ("EffectMaskTex(RGBA)", 2D) = "white" {}
|
|
_UVRollMaskSpeed ("UVRollMaskSpeed", Vector) = (0, 0, 0, 0)
|
|
|
|
// 整合mb_fresnel效果 (文件名 mb_fresnel.shader)
|
|
_FresnelColor ("Fresnel Color", Color) = (1,0.22745,1,1)
|
|
_FresnelIntensity ("Fresnel Intensity", Range(0, 50)) = 3
|
|
|
|
// 整合mb_outline效果,并保持开启 (文件名 mb_outline.shader)
|
|
_OutlineColor ("Outline Color", Color) = (1, 1, 1, 0)
|
|
_OutlineIntensity ("Outline Intensity", Range(0, 50)) = 1
|
|
|
|
// 整合scan效果 (文件名 ZGD_scan_002.shader ZGD_scan_003效果相同)
|
|
// 最多同时存在两个扫描效果,效果1使用 RG通道分别实现原先的 _Gridlinetex和 _Masktex 效果2使用 BA通道
|
|
_ScanTex("ScanTex", 2D) = "white" {}
|
|
_ScanColor("ScanColor", Color) = (1,1,1,1)
|
|
_ScanIntensity("ScanIntensity", Float) = 0
|
|
// 用这个代替扫描图网格图原先的各个缩放比例
|
|
_GridlineST("GridlineST", Vector) = (1, 1, 1, 1)
|
|
_ScanSpeed("Scan Speed", Float) = 0.5
|
|
}
|
|
SubShader
|
|
{
|
|
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
|
Blend SrcAlpha One
|
|
ZWrite Off
|
|
Lighting Off
|
|
Fog { Mode off }
|
|
pass
|
|
{
|
|
CGPROGRAM
|
|
#pragma target 3.0
|
|
// #pragma shader_feature __ _ROLLADD_MAP
|
|
#pragma shader_feature __ _ROLLADD_NOISE_MASK_MAP
|
|
// #pragma shader_feature __ _EFFECT_MASK_MAP
|
|
#pragma shader_feature __ _MB_FRESNEL
|
|
// #pragma shader_feature __ _SCAN_TEX
|
|
|
|
#pragma vertex CmcVertNormal
|
|
#pragma fragment CmcFragFull
|
|
#include "CombineModelEffectCG.cginc"
|
|
|
|
ENDCG
|
|
}
|
|
}
|
|
CustomEditor "CombineModelEffectFull"
|
|
}
|