|
|
#1 | |
|
Registered User
Join Date: Nov 2006
Posts: 2
|
Hi,
I use glBlendColor (0,0,0,1) to set the alpha value to 1. Then i do a glBlendFunc (GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA). However the glBlendColor does not really set the alpha value. When i read it out after the call to glBlendColor, it is still 0. Therefore I see no image on the screen when I do a glDrawPixels(..) (because the src var of glBlendFunc = 0 and the dst var = 1, so the image to draw is complete transparent). Does anyone know this problem, or has a solution for it ? Grtz, Jeroen. |
|
|
|
|
|
|
#2 | |
|
NVIDIA Corporation
Join Date: Mar 2005
Posts: 2,487
|
glBlendColor doesn't set the output alpha of fragments, it just controls the coefficients in the blend equation. You'll need to control the output alpha some other way, e.g. with glColor4f. Alternatively, you can disable blending or use glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA) before performing the glDrawPixels.
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Nov 2006
Posts: 2
|
OK, I named it wrong (is my unexperience with opengl-stuff), but I use the glBlendColor for Blending purposes. And I already use the glBlendFunc this way. I cannot disable blending, because then my application does not work correct anymore.
Here is a part of the code that I am using: GLfloat cae[4]; glGetFloatv (GL_BLEND_COLOR, cae); Log("cae=[%f,%f,%f,%f]\n", cae[0],cae[1],cae[2],cae[3]); glBlendColor(0.0, 0.0, 0.0, 0.9); glGetFloatv (GL_BLEND_COLOR, cae); Log("after glBlendColor: cae=[%f,%f,%f,%f]\n", cae[0],cae[1],cae[2],cae[3]); glEnable(GL_BLEND); glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA); glTranslated(the_view->left + 0.5, the_view->bottom + 0.5, 0.0); glRasterPos2d (0.0, 0.0); glDrawPixels(width, height, GL_BGRA, GL_UNSIGNED_BYTE, the_view->image); Both loggings display an alpha value of 0.0 (all four values are 0.0), so the glBlendColor has no effect. Therefore I see no picture after the call to glDrawPixels, because glBlendFund is called with src=0 and dst=1; This application works fine under Solaris, but on Linux it doesn't work anymore Grtz. |
|
|
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Post working out problem with 40.xx trying to work problem out, ONLY system specs | b5fan | NVIDIA Windows Graphics Drivers | 11 | 10-19-02 09:17 AM |
| Sony SDM-S51 monitor and GeForce4 problem | hassasin | NVIDIA GeForce 7, 8, And 9 Series | 4 | 10-12-02 04:10 PM |
| nv30 problem rumor | bob747b | Rumor Mill | 37 | 10-10-02 03:14 PM |
| Win XP problem with regards to CD ROM | MUYA | Microsoft Windows XP And Vista | 4 | 08-03-02 09:51 AM |
| Nvidia Go on laptop, black border within XFree86 problem | raxip | NVIDIA Linux | 3 | 07-31-02 10:58 AM |