https://catlikecoding.com/unity/tutorials/custom-srp/post-processing/
用一个全屏三角形和使用一个面(四个点,两个三角形)的好处
增加本地缓存命中
避免对角线的像素绘制两次问题(因为两个三角公用,每个三角形渲染一次,渲染两次)
顶点从6个减少到3个

全屏三角形原理
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-semantics

Unity裁剪空间坐标系为左手坐标系,三角形构造顺序为顺时针
红线处为原始三角形,顶点顺序为(0,1,2),UV为(0..1)

现将三角形放大两倍,顶点顺序为(-1,3,3),UV也相应放大两倍(0..2)。黄色区域刚好就是UV为0..1的矩形区域



Bloom
分离的滤波原理
Blur Filter 的权重值由来
Bilinear Filtering upsampling 问题:在高收缩率或者运动的图像升采样时,会产生块状斑纹
Although the Gaussian filter produces smooth results we still performing bilinear filtering when upsampling, which can give the glow a blocky appearance. This is most obvious where contract in the original image is high, especially when in motion.
Bicubic Upsampling 可以解决这个问题
Bloom Threshold












