最近做的项目是二次元,二次元的标杆就是崩坏3,效果真的好
学习崩坏3里面shader最好的方法就是看源码
可以AssetStudio来看资源,因为崩坏3资源是没有加密直接可以看
不过shader源码是已经编译好的,其实大概算法都在
我已经研究角色身上的shader,这个有空写博客,用到顶点绘制的工具来填充颜色来处理阴影
这次我参考崩坏里面的信号干扰的shader
之前搞个一个类似信号干扰
https://blog.csdn.net/SnoopyNa2Co3/article/details/84673736
下面效果
我看了一下没有特别的算法,那个噪音的都是经验公式,了解的话可以自行搜索一下
下面是编译过的shader
Shader "miHoYo/UI/Image TV Distortion" {
Properties {
_MainTex ("Sprite Texture", 2D) = "white" { }
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_BackgroundColor ("Barckground Color (RGBA)", Color) = (0,0,0,1)
_AdjustColor ("Adjust Color (RGB)", Color) = (0,0,0,1)
_DistortionTex ("Distortion Tex (RG)", 2D) = "gray" { }
_DistortionFrequency ("Distortion Frequency", Float) = 1
_DistortionAmplitude ("Distortion Amplitude", Range(0, 1)) = 1
_DistortionAnmSpeed ("Distortion Animation Speed", Float) = 1
_ColorScatterStrength ("Color Scatter Strength", Range(-0.1, 0.1)) = 0.01
_NoiseTex ("Noise Tex (RGB)", 2D) = "black" { }
_NoiseAnmSpeed ("Noise Animation Speed", Float) = 1
_NoiseStrength ("Noise Strength", Float) = 1
_BloomFactor ("Bloom Facto