We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Alpha channel behaviors in openGL
Page Index Toggle Pages: 1
Alpha channel behaviors in openGL (Read 385 times)
Alpha channel behaviors in openGL
Apr 22nd, 2006, 9:31pm
 
I'm having a problem fading out an entire image slowly in openGL.  I want to do this while other things are happening.   The way I want to do it is overlay a box with alpha =1 over my "stage", thus having it slowly fade to black or another color.  

the following code behaves very differently on (I'm assuming this is the difference) an nVidia card versus an ATI card.  I'm wondering if there is- A. a way around this,  or B. an alternative method of fading out the entire image VERY quickly (performance is key here- using the pixels array is too slow)

sorry if this is off-topic. it may be a more hardware related question-  but I really can't figure it out.  maybe there's another more native method of openGL to do something like this?


here's the code:

import processing.opengl.*;
void setup(){
  size(800,600,OPENGL);
 //size(400,400,P3D);
  background(0);
}
void draw(){
 rectMode(CENTER);
 translate(0,0,0);
 fill(255,0,0,50);
 rect(mouseX, mouseY, 55, 55);
 fill(0,0,255,1);
 rect(width/2,height/2,width/2,height/2);  
}

thanks for the help!


=josh
Page Index Toggle Pages: 1