Added global texture function