Sdílet prostřednictvím


GraphicsDeviceCapabilities.MaxTextureRepeat Property

Gets the maximum range of the integer bits of the post-normalized texture coordinates.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public int MaxTextureRepeat { get; }

Property Value

The maximum range of the integer bits of the post-normalized texture coordinates.

Remarks

A texture coordinate is stored as a 32-bit signed integer using 27 bits to store the integer part and 5 bits for the floating-point fraction. The maximum integer index, 227, is used to determine the maximum texture coordinate, depending on how the hardware does texture-coordinate scaling.

Some hardware reports the cap TextureCaps.SupportsTextureRepeatNotScaledBySize. For this case, the device defers scaling texture coordinates by the texture size until after interpolation and application of the texture address mode, so the number of times a texture can be wrapped is given by the integer value in MaxTextureRepeat.

Less desirably, on some hardware TextureCaps.SupportsTextureRepeatNotScaledBySize is not set and the device scales the texture coordinates by the texture size (using the highest level of detail) prior to interpolation. This limits the number of times a texture can be wrapped to MaxTextureRepeat / texture size.

For example, assume that MaxTextureRepeat is equal to 32K and the size of the texture is 4K. If the hardware sets TextureCaps.SupportsTextureRepeatNotScaledBySize, then the number of times a texture can be wrapped is equal to MaxTextureRepeat (32K, in this example). Otherwise, the number of times a texture can be wrapped is equal to MaxTextureRepeat divided by texture size, which, in this example, is 32K/4K, or 8.

See Also

Reference

GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista