View Full Version : problem doing texturing

04-16-2009, 10:51 PM
i have a 70mb file containing RGBA information which i need to use to texture on grid of 1200*1200 triangles...

problem occurs when i take the array to store image greatrs than 2048..
for array like this - GLfloat image[2048][2048][4], it works fine but texturing disappears for array -
GLfloat image[4096][4096][4] or anything above it.

how can i go about solvin this issue... pls help

Ilian Dinev
04-16-2009, 11:31 PM
check the max texture size you gpu supports.

04-19-2009, 10:38 PM
it is 2048 only in my gpu... so how can i go about texturing larger pictures???

04-22-2009, 09:55 AM
You can't with a single Texture_2D object.... you'll have to create in memory an array of textures to cover your needs, so an array of 4 2K*2K textures will suffice. This means that you'll have to break your rendering of the mesh into 4 chunks so that a different texture can be bound each time.
Alternatively, you could make use of shaders and the new TextureArray_EXT extension. Here, just like 3D textures, you can 'layer' your 4 tiled 2K*2K textures into a single GL texture. The beauty is that in the shader you can access the layer and draw the triangles with the appropriate texture. I'd suggest supplying a simple RGBA texture to use as a lookup - assuming that this is suitable for your model (a terrain perhaps?).