pass polymorphic funtion to texture