fixed triangle texture function