The way I've done this before is by taking the luminance of an image and either applying a box blur, Gaussian blur, or some other kind of blur, then a threshold for brightness, then doing a lerp between 0.0, the lens flare/luminance image, and the lens speckle/dirt texture. It's best to use it at 1/4 size though. Sometimes…