Advertisement

Why? Why?

Started by July 10, 2002 05:53 PM
3 comments, last by FERNANDO-BRASIL 22 years, 7 months ago
Guys... Let me ask a thing that I don''t and will never understand.... Why OpenGL don''t have a AlphaFunc function like this????: void AlphaFunc(GLenum func, GLfloat R, GLfloat G, GLfloat B); I''m making an OpenGL application and til now, I was using RGB mode. Now, because I want to ignore some pixels, I''ll have to turn to RGBA, and will spend 4 bytes for each pixel... So, why OpenGL don''t have a function like that? Fernando
first off, using 1555 allows easy masking with a single alphabit.

secondly, such a function as you suggest cant be done in hardware easily. you want colorkeying? use directdraw. you want 3d graphics use opengl or d3d.

i am not sure but you may be able to set up a mask on a second texture to handle the the removal of the particular color. do some research, not many ppl have this problem when sticking to 16bit color depth, you just happen to be thinking of things wrong (ie 2d directdraw you have control overe every pixel) insteda of the correct way (ie using 3d hardware thus give up control so the hardware can do the things it does fast and efficently).

in the end, its just you looking at things wrong. look on the forums about masking and 16bit textures.

what i wont understand is why do ppl continually use opengl and d3d for 2d games and expect things to work like in directdraw. use the right tool for the job and be aware of the pros and cons of your choice.
Advertisement
???????

Where do you read I''m making a 2D application???
I''m using OpenGL to make 3D Graphics if you didn''t understand well... And if you didn''t understand my question, I can give you a tip ''a person''. Get the OpenGL Red Book, and Open it at page 226. There is an example of a tree, made using QUADS and some transparency (BLENDING). But, I don''t want to use BLENDING in my application, because it requires a forth component called A...

Understood now ''a person''?
Um...you want to blend without alpha channel? That is what the alpha channel is there for in the first place. What you''re saying is like "I want to do fast projected shadows but I don''t want to use the stencil buffer."

And if using 4 bits for color instead of three is a major problem, you have a major problem.
''Real'' color keying in 3D would look pretty nasty. Imagine those ''edges'' caused by scaling a color keyed image in 2D, except they would appear on every surface in 3D. So, the easy solution to emulate color keying without visual degradation is to create an alpha channel beforehand.

This topic is closed to new replies.

Advertisement