WebGL Repeat a Texture

Texture Mapped with a Lighthouse

Use WebGL texture repeat wrap mode settings to tile textures across surfaces. Simply increment the S and T coordinates to the number of tiles required. Then set texParameteri() to REPEAT.

Tap the Rotate button to play the animation. The square plane rotates around the Y axis. Tap the lighthouse to rotate one frame at a time.

Your browser doesn't support canvas.

WebGL Tutorials and Examples

Enjoy the free online in-depth WebGL book, WebGL Textures & Vertices: Beginner's Guide. Also see free WebGL tutorials.

  1. Useful techniques for education, games, scientific visualization, and architectural rendering.
  2. Works with WebGL enabled Web browsers including Windows PCs, iPhone 6, and current Androids. Most examples also work with Windows Phone operating system 8.1.
Copyright © 2015 Seven Thunder Software. All Rights Reserved.