Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
131 user(s) are online (67 user(s) are browsing Forums)

Members: 1
Guests: 130

MickJT, more...

Headlines

 
  Register To Post  

OpenGL - Problem with texture color not correct
Quite a regular
Quite a regular


See User information
Hi All,
I don't think my problem is the "green texture" bug ...
When I create a texture color are messed.

Red -> Red
Green -> Pink
Blue -> Yellow
Red + Green -> Pink
Red + Blue -> Red
Green + Blue -> White
Red + Green + Blue -> White

Does someone know from where it can came ?

I use a RGBA raw file format ( 8 bytes for each component ). I create texture in GL_RGBA internally and use data format GL_RGBA with GL_UNSIGNED_BYTE ...

All we have to decide is what to do with the time that is given to us.
Go to top
Re: OpenGL - Problem with texture color not correct
Home away from home
Home away from home


See User information
@freddix

The colour channels of the source image are probably different from what OpenGL expects.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
Go to top
Re: OpenGL - Problem with texture color not correct
Quite a regular
Quite a regular


See User information
@Hans
Theorically not because I've made on my PC a program that write byte per byte the pixels and it stores them in that order : RED, GREEN, BLUE, ALPHA...

And I've found the problem... I use RGBA on my Amiga but I must store image pixels in that order : ALPHA, BLUE, GREEN, RED ...

Is this normal ?

All we have to decide is what to do with the time that is given to us.
Go to top
Re: OpenGL - Problem with texture color not correct
Just popping in
Just popping in


See User information
@freddix

I'm not an expert but has something to do with little-endian / big-endian stuff?

Go to top
Re: OpenGL - Problem with texture color not correct
Home away from home
Home away from home


See User information
@freddix

Yes this is normal, PC graphic card was designed for PC (x86), not for PowerPC.

You will find the same problem on the screens bitmap, her it was GBAR in 32bit.

Anyway 16bit graphics is horrible, now when I do graphic routines, I operate whit two color formats native and ARGB, normally on load time I convert all my images to native color format in the right pixel depth, this so I do simple copy pixel for pixel every thing.


Edited by LiveForIt on 2009/4/7 2:38:15
(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: OpenGL - Problem with texture color not correct
Quite a regular
Quite a regular


See User information
@LiveForIt
Ok, so even if OpenGL said RGBA, it's in fact ABGR ... Right ?

All we have to decide is what to do with the time that is given to us.
Go to top
Re: OpenGL - Problem with texture color not correct
Home away from home
Home away from home


See User information
@freddix

Quote:

freddix wrote:
@Hans
Theorically not because I've made on my PC a program that write byte per byte the pixels and it stores them in that order : RED, GREEN, BLUE, ALPHA...

And I've found the problem... I use RGBA on my Amiga but I must store image pixels in that order : ALPHA, BLUE, GREEN, RED ...

Is this normal ?


If you're writing the elements byte by byte (i.e., into a uint8*/unsigned char* buffer) then it should work the same way if the OpenGL program is run on a PC or the Amiga. IIRC, I had to perform byte-swapping when using OpenGL under windows too, but I can't remember what the source format was.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project