Advertisement

texture tiling in Opengl

Started by June 27, 2005 05:44 AM
1 comment, last by Steve132 19 years, 5 months ago
I am working on the OpenGL ES platform. I have written the relevant routines for texture mapping. I however require 'tiling' functionality in my texture mapping routine. Here i face a problem. I am using indexed vertex arrays for rendering objects. The GLES paradigm as i have understood it, allows for a single index array that references elements in the various arrays such as the vertex array, the colour array, the texture array, etc. [that are then rendered using the glDrawElements function] This paradigm does not allow for multiple texture co-ordinates for a single vertex, without creating duplicate vertices or continuously rewriting sections of the texture buffer, which would be expensive. This is why, i am finding it difficult to implement tiling functionality in my texturing routine. One possible solution would be using texture matrices, but this also has its overhead, as the texture co-ordinates would have to include rotation and translation data for the texture matrix. This is hard to generate and has obvious processing overheads, which i would like to avoid. Plz advice.
Can't you just multiply the actual UV texture coorinates by some tiling factor...

0.5 = half tiling
1 = no tiling
2 = tiled twice
3 .... and so on.
Advertisement
The single vertex data thing is certainly a bitch. I have tried to figure out the same thing myself. However, for your particular problem I would definatly render the tiles using the standard opengl tiling, which is one giant quad with UV coordinates beyond 1.0f, just like previous poster suggested. The UV wraps around one texture over and over.

This topic is closed to new replies.

Advertisement