Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Thread Tools
Old 11-21-06, 08:50 AM   #1
Registered User
Join Date: Nov 2006
Posts: 2
Default Blend problem


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 ?

JeroenH is offline   Reply With Quote
Old 11-21-06, 11:19 AM   #2
NVIDIA Corporation
AaronP's Avatar
Join Date: Mar 2005
Posts: 2,487
Default Re: Blend problem

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.
AaronP is offline   Reply With Quote
Old 11-23-06, 05:31 AM   #3
Registered User
Join Date: Nov 2006
Posts: 2
Default Re: Blend problem

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);

glBlendColor(0.0, 0.0, 0.0, 0.9);

glGetFloatv (GL_BLEND_COLOR, cae);
Log("after glBlendColor: cae=[%f,%f,%f,%f]\n",



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

JeroenH is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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

All times are GMT -5. The time now is 03:58 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.