Hello,
I am trying to wrap a texture around a sphere. I was able to follow the tutorial on http://home.clara.net/paulyg/ogl.htm to load the texture of the earth in .raw form. However, the image I want to use is a jpg, so I downloaded DevIL. I think that I am loading the texture correctly because I am not getting any errors. But my sphere is turning out black. Here is my code:

Generally a good sign that your not setting up textures correctly is when everything goes white. Everything going black is usually a sign that you've set up the lighting wrong. Can't see any lighting stuff in the code you sent. Are you using lights anywhere else?

dabeav

06-25-2002, 12:59 PM

Try this, the proper way to set up a devIL image is like this. They way you have it setup might cause some issues.

dabeav -
Using the setup for devIL you suggested, my sphere turned white. Any ideas????

Thanks again,
Allison

Mazy

06-26-2002, 04:40 AM

is the jpg image in n^2 size?

dabeav

06-26-2002, 04:52 AM

Hmm??

Lets start from square one here. First, what Compiler you using? I know that devIL has to have the Code Generation set to multithreaded dll to work correctly, did you change that setting in the compiler?

Second, did you add glut to your project.

Third, how did you set up your devIL image variable, I use ILuint, which maps to a C++ unsinged int. But I stick with the ILuint to keep things portable. ie: ILuint Image;

Forth, did you set up your main "exactly" like shown?
ilInit(); HAS to come before glutInit();
and ilutRenderer(ILUT_OPENGL); has to come after glutInit(); or it wont work at all.

If this dosnt work, please either post more code, we will get this yet.

Edit: Oh by the way, i dont think you need these
iluInit(); ilutInit();

[This message has been edited by dabeav (edited 06-26-2002).]

agreene

06-26-2002, 05:43 AM

Mazy-
I believe that the image is n^2.

dabeav-
I'm using BCB 5. I'm not quite sure how to check the multithreaded dll setting.

I'm currently in the process of adding glut to my project, its taking me a bit, because I've never used the library before.

I used ILuint as my image variable.

So I'll get back to you with more code once I finish adding the glut.

Allison

Jeffry J Brickley

06-26-2002, 06:10 AM

Also check the size of image and the memory it will occupy on board. We have images turning black when we exceed the maximum texture size of 4kx4k on our boards (2kx2k on older boards). This also occurs when the total texture memory on the board is exceeded (for instance, loading 2 4K textures).... Remember some boards store 4 bytes per pixel reguardless of image, so 4kx4k (16mb * color components RGBA) would be 64Mb, no room even for rasterization on a 64Mb board. Mipmapping increases texture memory by 4/3. When you exceed a limit, a board/driver has two choices, ignore it, or swap with real memory. Both choices are bad.... Ignoring it often results in black-out textures (especially on Nvidia hardware), swapping generally results in an instant drop to 1/10 frame rate or less. Image size for mip-mapping, I think, is limited to 512x512 max on some boards, so you can only go higher in texture size if you don't use mipmaps (however, that problem, in my experience, is generally characterized by a crash of the program during Mip-map creation and storage). When diagnosing texture problems, I often drop the texture size down to 512x512 or 256x256 for debugging and then step up from there. There are also serious performance problems with textures greater than 1kx1k on pre lightning memory architecture boards (DDR double pumped throughput).

Ok, I believe Ilut, operates ontop of glut, so you need that atleast initialized in the program. Im not positive, but I think so. Never tried it without. But you do have to figure out how to set the multithreaded DLL setting to your project, thats a biggie, may not be causing your problem currently, but will eventualy. Let me know how things work out for ya.

agreene

06-26-2002, 11:15 AM

Thank you to everybody for you help. With a little bit of work and a lot of frustration I was finally able to correct my code and get an error message.