pub enum WrapMode {
Wrap,
Mirror,
Clamp,
Border,
None,
}
Expand description
Wrap modes that affect the interpretation of s
, t
, and p
texture coordinates in Sampler*
elements.
Variants§
Wrap
OpenGL symbol GL_REPEAT
.
Ignores the integer part of texture coordinates, using only the fractional part.
Mirror
OpenGL symbol GL_MIRRORED_REPEAT
.
First mirrors the texture coordinate.
The mirrored coordinate is then clamped as described for Clamp
.
Clamp
OpenGL symbol GL_CLAMP_TO_EDGE
.
Clamps texture coordinates at all mipmap levels such
that the texture filter never samples a border texel.
Note: GL_CLAMP
takes any texels beyond the
sampling border and substitutes those texels with
the border color. So CLAMP_TO_EDGE
is more
appropriate. This also works much better with
OpenGL ES where the GL_CLAMP
symbol was
removed from the OpenGL ES specification.
Border
OpenGL symbol GL_CLAMP_TO_BORDER
.
Clamps texture coordinates at all MIPmaps such that
the texture filter always samples border texels for
fragments whose corresponding texture coordinate
is sufficiently far outside the range [0, 1].
None
The defined behavior for None
is consistent with
decal texturing where the border is black. Mapping
this calculation to GL_CLAMP_TO_BORDER
is the best approximation of this.