【shader】学习记录贴 Day6 色差处理
shader吧
全部回复
仅看楼主
level 8
縩🐷师傅 楼主
_MaskTex 用来做扫描线遮罩
fixed4 mask = tex2d(_MaskTex,i.uv*_maskSize)
lerp(base,mask,_maskBlend)
2023年07月06日 01点07分 1
level 8
縩🐷师傅 楼主
public Material m;
void OnRenderImage(RenderTexture src,RenderTexture dest)
{
if(m==null)
{
Graphics.Blit(src,dest);
}
else
{
Graphics.Blit(src,dest,m);
}
}
2023年07月06日 01点07分 2
level 8
縩🐷师傅 楼主
【Distortion】扭曲 扭转 变形
位移纹理(相当于凹凸贴图)
用来显示位移像素,从颜色0 ,1 变成-1到+1 (红绿贴图)
fixed4 frag(v2f_img i):SV_Target
{
half2 n =tex2D(_DisplaceTex,i.uv);//得到法线方向,颜色值
half2 d = n*2-1;//颜色值转为单位向量
i.uv += d * strength;//uv坐标进行偏倚
i.uv =saturante(i.uv);//限制在0-1
float4 c = tex2D(_MainTex,i.uv)
}
2023年07月06日 01点07分 3
level 8
縩🐷师傅 楼主
【高斯方程】
2023年07月06日 06点07分 4
level 8
縩🐷师傅 楼主
卷积核越大,模糊程度越高
2023年07月06日 06点07分 5
level 8
縩🐷师傅 楼主
加权 乘积 求和
越接近中心 对模糊值影响越大
维数越高 模糊程度越高
2023年07月06日 06点07分 6
1