From: Kenneth B. R. <kbr...@al...> - 2003-03-22 00:55:13
|
> From: Mark Montana <pat...@lm...> > > (Q1) I am loading fairly large textures of satellite imagery of > the Earth. Two of them are 1024x1024 (powers of two) in RGB > format. These two images load and render just fine. The third > texture is 2048x1024 (also powers of two) in RGB format. This > one gets a GL error during my call to glTexImage2d(), and the > error is "invalid value." I determined that value that makes it > unhappy is the image width (2048). If I lie to OpenGL and tell > it that the width is only1024, the image loads and renders > without an error (of course it looks screwed up, but I expect > that since I lied about the true width). Any insight on why it > cannot handle the 2048 width? The 1024 width call is not just going to look wrong, it's also going to use half the texture memory. > I know that it is not related to the hardware, graphics card, > graphics card driver, or machine configuration. I know this > because our application is half GL4Java and half Java3D. The > Java3D display loads the same exact textures and renders them > with no problem. I also do not think it is related to the total > amount of texture memory available; again because Java3D has no > problem, and I can disable the Java3D display and disable to > two 1024x1024 textures in the GL4Java display...and the GL4Java > display still gets the same error on the 2048x1024 texture. It sounds to me like you're running low on texture memory. Splitting the texture into two sub-textures will allow the OpenGL implementation to swap out one texture while rendering the other. This won't be able to be done with the one large texture. > Could it have something to do with the OpenGL context or > configuration that I am requesting??? > Could it be related to the fact that I am using display-lists??? Don't know. > (Q2) My textures are rendered in a 2D display, no lighting, no > normals, no materials. The polygons underneath the texture are > white. The texture comes out way to dark with GL_DECAL or > GL_REPLACE. When I try GL_MODULATE or GL_BLEND, it gets really > washed-out. We had this same exact problem in the Java3D > display with these textures. We fixed it there by using some > texture-environment settings that are unique to Java3D. (In > other words, the Java3D people used some of the more advanced > features of blending functions and/or filters to create a new > blending equation that works well.) I was considering a > decompile of the Java3D code to see how they did it, but I > thought I would as for some advice on this problem first. Altering the whiteness of the polygons should allow you to control how washed-out the texture appears with GL_MODULATE. I've found it was necessary to disable lighting while rendering decal-style textures. See the sources to the Grand Canyon demo at http://java.sun.com/products/jfc/tsc/articles/jcanyon/ , in particular Sky.java (which turns on lighting only when rendering the sky hemisphere) and MultiResTile.java, which sets up the texture environment for the terrain. -Ken |