Moving more code from Preview to the Renderer

-Moving the shader