grayscale loaded as gl_alpha: all texture is white
based on this source code,
http://www.71squared.com/2009/03/iphone-...utorial-1/
i had tried to load a grayscale and loading as alpha...
what i have changed is:
in eglview, in init functions i have loaded 2 images, one grayscale, and rendered them with this gl init
in texture2d:
but what is displayed is a rectangle all white
do someone have an example od loading grayscale as alpha or can someone look this code?
example
i'm not able to find the error
thanks
http://www.71squared.com/2009/03/iphone-...utorial-1/
i had tried to load a grayscale and loading as alpha...
what i have changed is:
in eglview, in init functions i have loaded 2 images, one grayscale, and rendered them with this gl init
PHP Code:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
// glDisable(GL_DEPTH_TEST);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND_SRC);
PHP Code:
CGColorSpaceRef imref=CGColorSpaceCreateDeviceRGB();
if(!CFEqual(imref,CGImageGetColorSpace(image)))pixelFormat = kTexture2DPixelFormat_A8;
do someone have an example od loading grayscale as alpha or can someone look this code?
example
i'm not able to find the error
thanks
I don't know, but the first thing you should do is get rid of that texEnv call. The default is
and I can't imagine why you'd use anything else.
Code:
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);and I can't imagine why you'd use anything else.
thanks for the fast reply.
i have putted glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND_SRC);
because in other threads around the web i have found it as a fix for this problem.
however, i tried glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); and doesn't solve this problem.
strange thing:
if i load the image as a rgb without alpha, the image is displayed correcly...
i gave managed the image in photoshop, and it results (as it say) grayscale/8.
i have opened windows paint and copy/paste the image and saved as bmp, nothing changed
i have putted glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND_SRC);
because in other threads around the web i have found it as a fix for this problem.
however, i tried glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); and doesn't solve this problem.
strange thing:
if i load the image as a rgb without alpha, the image is displayed correcly...
i gave managed the image in photoshop, and it results (as it say) grayscale/8.
i have opened windows paint and copy/paste the image and saved as bmp, nothing changed
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| grayscale loaded as gl_alpha: the opaque image can be only white? | sefiroths | 2 | 5,013 |
Jan 14, 2011 08:06 AM Last Post: sefiroths |
|
| Drawing a subview loaded from a bundle | Joseph Duchesne | 8 | 4,650 |
Feb 14, 2006 08:32 PM Last Post: PowerMacX |
|
| NSView loaded from bundle won't draw... | Joseph Duchesne | 1 | 3,099 |
Feb 12, 2006 03:33 AM Last Post: Cochrane |
|

