Texture Basic Question(s)...
I've been debugging a problem for a long time, and wanted to talk it out.
I've got RGBA images that I read in and can display to the screen fine.
But I've gotten these black and white (well gray) images that don't seem to
be working.
Given an image that Graphic Converter says is "Colors: 256 Grays, 8 bit", wouldn't the only valid valued for the format parameter be GL_LUMINANCE?
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, ..., format, GL_UNSIGNED_BYTE, &((*pdata)[0]));
I don't suppose there is something that needs do be turned on or off between displaying RGBA and Gray Textures?
thanks in advance.
I've got RGBA images that I read in and can display to the screen fine.
But I've gotten these black and white (well gray) images that don't seem to
be working.
Given an image that Graphic Converter says is "Colors: 256 Grays, 8 bit", wouldn't the only valid valued for the format parameter be GL_LUMINANCE?
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, ..., format, GL_UNSIGNED_BYTE, &((*pdata)[0]));
I don't suppose there is something that needs do be turned on or off between displaying RGBA and Gray Textures?
thanks in advance.
LUMINANCE, ALPHA and INTENSITY are all 1-channel formats.
Of course, how your image format and loader represents a grayscale image is an entirely different matter, and "doesn't work" isn't all that descriptive...
Of course, how your image format and loader represents a grayscale image is an entirely different matter, and "doesn't work" isn't all that descriptive...
Your image loader may be converting into RGBA during load/decompress, which in this case would be a waste of time and space.
Take a look at the raw bytes you are passing to glTexImage to see what's what.
Take a look at the raw bytes you are passing to glTexImage to see what's what.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Basic OpenGL reshape function question... | WhatMeWorry | 2 | 5,354 |
Mar 30, 2011 07:05 AM Last Post: Ingemar |
|
| problem with basic texture mapping class | wyrmmage | 8 | 3,603 |
Dec 22, 2006 02:25 PM Last Post: wyrmmage |
|
| Depth Buffer / Testing basic question... | WhatMeWorry | 5 | 5,883 |
Nov 18, 2005 12:50 AM Last Post: arekkusu |
|
| General Texture Question.... | WhatMeWorry | 5 | 3,677 |
Aug 5, 2005 09:38 PM Last Post: WhatMeWorry |
|
| Basic Texture Mapping | hangt5 | 5 | 3,193 |
Dec 14, 2004 12:29 PM Last Post: hangt5 |
|

