Texture Coordinates and GluSphere

I would like to apply a massive texture on a sphere (16384x8192), but I believe this doesn’t work at these sizes. I am using a standard File object and creating TextureData with it which I then set the internal format of the data to compressed DXT1 (supposedly this should decrease the memory required for the texture by 8x). I then create a Texture object with this TextureData. The thing I apply this texture to is a glusphere. I automatically generate the texture coordinates with the glu method “gluQuadricTexture”.

This works fine when I had a single 8912x4096 image that I used as a texture, but using the larger image means the texture doesn’t appear on the screen. What approach could I take to place this larger image on that sphere?

I was thinking of cutting the image up it into 4 pieces as putting those individually on the sphere. If the compression of the TextureData works as it is supposed to, the total memory requirement for the 16384x8192 is 64MB I think. Is there any way to do this without actually creating the sphere vertices and texture coordinates manually one at a time?

You may be running into the maximum texture size supported by your card (int[] maxTexArray = new int[1]; gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, maxTexArray, 0); maxTexArray[0] contains the result).

I’m not sure of your application, but are you aware of the NASA World Wind Java SDK and its developer forums?

http://worldwind.arc.nasa.gov/java/
http://forum.worldwindcentral.com/

I confirmed that it is hitting the texture size limit with your code (mine only goes to 8192 and I was tried to use a texture with a 16384 length).

Regarding the main question in my previous post, do you have any recommendations on how I can build and texture the two halves of the sphere separately? I suppose I could try building it vertex by vertex manually, but I would like to know if an easier method exists or not.

Thanks

Hi,

It’s quite easy to build the two side of the sphere and set texture coordinates to it. I don’t say easier way to do it… Just two loops, and you can use whatever mesh you want to improve perf or easyness for your code.

It should be easy to try, but I don’t know if I will do it right. I really am not sure how the texture that I was using was automatically mapped onto the sphere. Do you know how exactly the opengl does automatic texture mapping of a glusphere?

The glusphere was made of squares which are of varying sizes (smaller as you get toward the poles). Does each “square” on the sphere get an equally sized square from the texture image? Or do the squares near the poles have squares from the texture image with slightly smaller dimensions?

Well, you get into the problem of mapping a rectangular area on a sphere…
You’re right, the area of quads near the poles will be smaller (not slightly)
As with geographical data you have to choose an appropriate projection and maybe use different textures depending on what part of the sphere you are looking at. As an example, and If I remember well, the automatic mapping doesn’t allow you to map a texture of earth on a sphere in a correct way, you have to specify the texture coordinates yourself.