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

Newegg Daily Deals

Reply
 
Thread Tools
Old 06-20-03, 10:59 AM   #1
artm
Registered User
 
Join Date: Jun 2003
Posts: 5
Unhappy blending with alternative read buffer

Hello

dunno if programming problems shoud go here, but:

i'm trying to blend frames using the following code:
-------------------------------------------------
glXMakeContextCurrent(
glmixer->dpy,
glmixer->glx_drawable,
glmixer->channels[0],
glmixer->glx_context);

/* prepare */
glDrawBuffer(GL_BACK);
glReadBuffer(GL_FRONT);
glDisable(GL_BLEND);
glCopyPixels(
0,0,glmixer->w,glmixer->h,GL_COLOR);

glXMakeContextCurrent(
glmixer->dpy,
glmixer->glx_drawable,
glmixer->channels[1],
glmixer->glx_context);

glEnable(GL_BLEND);
glBlendColor(0,0,0,glmixer->alpha);
glBlendFunc(
GL_CONSTANT_ALPHA,
GL_ONE_MINUS_CONSTANT_ALPHA);
glCopyPixels(
0,0,glmixer->w,glmixer->h,GL_COLOR);

/* flush, swapbuffers ... */
-------------------------------------------------
here glmixer->glx_drawable is double buffered GLXWindow, and channels[] are signgle buffered glXPbuffer's containing preprocessed frames i wanna blend together.

instead of what i want the second CopyPixels seems to use front buffer of the window as a source: I see "motion blur" sort of effect with the image from the first channel.

i found the following (allegedly opengl-implementation neutral) statement on mesa mailing list:

" There are basically two situations in which you need to read from a color buffer:

1. glRead/CopyPixels() and glAccum()
2. blending/logicops/masking

In the first case, the source buffer is whatever glReadBuffer() indicates...

In the second case, the source buffer is what glDrawBuffer() indicates." (URL: http://www.geocrawler.com/archives/3...2/7/0/9125102/ )

I'm not sure if it explains what happens with my code and wether what i experience is correct behaviour. I almost suspected this to be a bug in a driver or something, but may be I just misunderstand the OpenGL specs?
__________________
cheers,
artm
artm is offline   Reply With Quote
Old 06-20-03, 11:02 AM   #2
artm
Registered User
 
Join Date: Jun 2003
Posts: 5
Default Re: blending with alternative read buffer

almost forgot: my driver version is 1.0.4363, OS - linux.
__________________
cheers,
artm
artm is offline   Reply With Quote
Reply


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
GPU memory consumption, back buffer, Quadro tdsussman NVIDIA Linux 5 08-14-12 09:14 PM
APM (nonsuspend) hard-lockups - I READ THE FAQ idangazit NVIDIA Linux 9 12-27-02 07:43 AM

All times are GMT -5. The time now is 05:11 PM.


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