line with 1% alpha issues
in
Programming Questions
•
8 months ago
hi guy's
i ran into an old Processing issue of overlapping lines with a stroke of 1% alpha, basically my goal here is to draw a lot of black lines with a 1% alpha eventually the hole screen should be 100% black, but the result is a light grey (see example below) i remember this problem from way back to P3 V0.9 but kind of hoped it would have been solved by now!
1. why is this happening ?
2. is there ANY way of solving this in Processing ?
3. are there other optimized drawing api's for Processing ? (must be ultra fast ;)
4. any tricks using opengl etc. ??
thanks :)
example code
- PGraphics big;
- int w, h;
- void setup(){
- size(600, 600, P3D);
- w = 496;
- h = 496;
- big = createGraphics(w,h, P3D);
- big.beginDraw();
- big.background(255);
- big.endDraw();
- }
- void draw(){
- big.beginDraw();
- big.stroke(0,0,0,1);
- for(int i=0; i<1000; i++){
- big.line(0,0,random(w),random(w));
- }
- big.endDraw();
- image(big, 0,0);
- }
1