Put in template for tracing ray in pixel loop