* replaced 'max' with if in shader