diffuse and spec functions work with ray input