separated texture sampling into its own class