Added texture support and fog equations.