TextureWrap

View source

Selects how texture coordinates outside the normalized range are handled.

Pass a member to WebGLRenderingContext#texParameteri for the TEXTURE_WRAP_S or TEXTURE_WRAP_T parameter.

Examples

import { TextureWrap } from '@wimaengine/render-webgl'

gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, TextureWrap.Repeat)
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, TextureWrap.Clamp)

Variants


Repeat

View source

Repeats the texture across the coordinate range (0x2901, REPEAT).

Clamp

View source

Clamps coordinates to the texture edge (0x812F, CLAMP_TO_EDGE).

MirrorRepeat

View source

Mirrors the texture on alternating repeats (0x8370, MIRRORED_REPEAT).