|
|
- // author : Saber
- // date : 2020/12/2
- // desc : 本着色器的目的是整合项目中已有的【模型用透明通道特效】,会保留原先shader的全部参数以及实现
- // 旨在减少多个材质对同一模型顶点和面片的多次处理,整合特效shader效果
-
- // CombineModelEffectLow:拥有一种UVRoll效果(单效果纹理)以及一种Scan效果(单纹理单效果双通道)
- Shader "SaberShad/CombineModelEffectLow"
- {
- Properties
- {
- // 被整合的shader参数逐条对应,为了方面识进行了适当的改名
- // 整合uvrolladd_noise_mask效果 (文件名 sy_uvrolladd_noise_mask.shader)
- _UVRollTex ("UVRoll Tex", 2D) = "white" {}
-
- _UVRollColor1 ("UVRoll Color1", Color) = (1, 1, 1, 1)
- _UVRollSpeed ("UVRollSpeed", Vector) = (0, 0, 0, 0)
- _UVRollIntensity1 ("UVRoll Intensity1", 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通道(B给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效果相同)
- // 最多同时存在一个扫描效果,使用 RG通道实现原先的 _Gridlinetex和 _Masktex
- _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 CmcVertLow
- #pragma fragment CmcFragLow
- #include "CombineModelEffectCG.cginc"
-
- ENDCG
- }
- }
- CustomEditor "CombineModelEffectLow"
- }
|