Optimized texture representation.

Previously texture lookup required two memory lookups.