1. A programmable graphics processor for generating an image using a filtered texture sample, comprising: a storage element configured to store a plurality of trilinear optimization values, wherein each trilinear optimization value is associated with a different texture; and a level of detail (LOD) optimization unit coupled to the storage element and configured to receive a selection of a texture, an LOD value for the selected texture, and the trilinear optimization value associated with the selected texture, and to produce an optimized LOD value, wherein the LOD value includes a fractional portion and an integer portion, and the trilinear optimization value is an optimized fraction, wherein the LOD optimization unit is further configured to compute a modified fractional portion of the LOD value using the fractional portion of the LOD value and the trilinear optimization value, and wherein the LOD optimization unit is further configured to sum together the modified fractional portion of the LOD value and the integer portion of the LOD value to produce the optimized LOD value, which determines whether a bilinear interpolation or a trilinear interpolation operation is used to produce the filtered texture sample based on the selected texture.