bugClanLib - Bugs: bug #4418, only very few colors in OpenGL

 
 

bug #4418: only very few colors in OpenGL

Submitted by:  Ingo Ruhnke <grumbel>
Submitted on:  Tue 22 Jul 2003 07:32:57 PM UTC  
 
Category: clanDisplaySeverity: 3 - Normal
Item Group: Incorrect BehaviourStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedRelease: 0.7-CVS
Operating System: GNU/LinuxPlanned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 22 Aug 2003 10:17:14 AM UTC, comment #6:

Added a new surface hint called automatic, and made that hint the default one. It now scans the surface for what colors it is using and picks the desired transparency level from that.

This should solve low colors for all cards that support GL_RGB5 and GL_RGB5_A1.

Magnus Norddahl <mbn>
Project Administrator
Fri 22 Aug 2003 01:05:08 AM UTC, comment #5:

Ok, added support for picking better texture format via the hint flag for CL_Surface.

Next thing is to make CL_Sprite support the hint flag as well, and let the sprite and surface resources support the hint flag.

I'm going to bed - good night ppl. :)

Magnus Norddahl <mbn>
Project Administrator
Fri 22 Aug 2003 12:50:13 AM UTC, comment #4:

Following code can be used to determine what image format the OpenGL driver would choose for a texture:

glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);

GLint chosen_format = GL_RGBA8;
glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, GL_TEXTURE_INTERNAL_FORMAT, &chosen_format);

Magnus Norddahl <mbn>
Project Administrator
Thu 21 Aug 2003 11:58:18 PM UTC, comment #3:

Ok sphair just pointed out another possibility. Maybe these old cards only support 16 bit textures. In that case, specifying GL_RGBA8 helps nothing, they will still choose to fall back on using GL_RGBA4 (4 bits per channel).

The following other GL hints may be of use:

GL_RGB5 = RGBA(5,5,5,0)
GL_RGB5_A1 = RGBA(5,5,5,1)
GL_RGBA4 = RGBA(4,4,4,4)

Unfortunately this require ClanLib to make a more intelligent pick for the texture format. Surfaces with no alpha should pick RGB5, those with only colorkey style transparency should pick RGB5_A1, and finally fully alpha'ed surfaces would have to pick RGBA4.

One solution could be to push the problem to the game developer, using the Hint parameter for surfaces.

Magnus Norddahl <mbn>
Project Administrator
Thu 21 Aug 2003 09:30:07 AM UTC, comment #2:

TGA surfaces I load using
surface = new CL_Surface("filename.tga");
and display using
surface->draw(x,y);
are dithered, i.e. they seem to be drawn at an 8 bit color resolution instead of 24 bit.

Any picture format of choice to have true 24 bit surface display? Unless this is a limitation of OpenGL with my video card? (I am using XFree 4.3 and I have an ATI All-In-Wonder Rage Pro 128).

Guillaume Pratte
http://www.dmi.usherb.ca/minvaders/en/

Kenneth Gangstoe <sphair>
Project Administrator
Thu 14 Aug 2003 09:33:43 PM UTC, comment #1:

Ok changed the CL_Surface construction code to specify GL_RGBA8 instead of GL_RGBA for the internal format of its textures.

According to OpenGL spec 1.4 this should request it to be 8 bits for each channel - if this doesn't fix the problem, there's not much we can do. It would be a driver bug/optimization thats out of ours hands.

Magnus Norddahl <mbn>
Project Administrator
Tue 22 Jul 2003 07:32:57 PM UTC, original submission:

ClanLib shows in OpenGL only very few colors, something like 16 or so. Looks like some problem with how textures are created. See the attached screenshot for an example, normally it should be full of smooth gradients.

Ingo Ruhnke <grumbel>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #549:  pingus-opengl.jpg added by grumbel (72KiB - image/jpeg - Screenshot of the color bug)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Fri 22 Aug 2003 10:17:14 AM UTCmbnStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)
Thu 21 Aug 2003 11:59:30 PM UTCmbnOpen/ClosedClosed=>(Error - Not Found)
Thu 21 Aug 2003 11:58:18 PM UTCmbnStatusFixed=>(Error - Not Found)
Thu 14 Aug 2003 09:33:43 PM UTCmbnStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1