Obvious improvement would be to provide the reference value as a uniform instead of forcing recompiles, but builtin uniforms are crazy so I thought I'd get it working first. -- Chris