Texture Basic Question(s)...

Member
Posts: 321
Joined: 2004.10
Post: #1
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
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...
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #3
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Basic OpenGL reshape function question... WhatMeWorry 2 7,055 Mar 30, 2011 07:05 AM
Last Post: Ingemar
  problem with basic texture mapping class wyrmmage 8 4,569 Dec 22, 2006 02:25 PM
Last Post: wyrmmage
  Depth Buffer / Testing basic question... WhatMeWorry 5 6,532 Nov 18, 2005 12:50 AM
Last Post: arekkusu
  General Texture Question.... WhatMeWorry 5 4,204 Aug 5, 2005 09:38 PM
Last Post: WhatMeWorry
  Basic Texture Mapping hangt5 5 3,711 Dec 14, 2004 12:29 PM
Last Post: hangt5