Simplify the shader with pre-defined functions.