2.0a5 - using any type of light() nullifies fill alpha on objects.
in
Core Library Questions
•
1 year ago
If I call light, directionalLight etc. the colors of surfaces becomes totally opaque as if alpha was set at maximum.
The same code in 2.0a4 work well however. Is this a bug to be resolved or should one use other lighting function with the new renderer?
Example:
The same code in 2.0a4 work well however. Is this a bug to be resolved or should one use other lighting function with the new renderer?
Example:
int w=1440,h=900, amm=10;
float apa;
void setup() {
size(w,h,P3D);
colorMode(HSB);
noStroke();
}
void draw() {
directionalLight(100, 255, 255, 0+(sin(apa/100)/10), 0.5, 1);
ambientLight(10,10,10);
background(210,255,255);
camera(width/2.0, height/2.0, (height/2.0) / tan(PI*30.0 / 180.0), width/2.0, height/2.0, 0, 0, 1, 0);
windows(0,-apa/100, 0);
apa++;
}
void windows(float rot, float dst, int i) {
float alp = 255/amm;
if (dst > -1) {
fill(255,255-alp*dst);
pushMatrix();
translate(0,h/2-sin(i)*400/2,(-w/3)*dst);
box(300,1000+sin(i)*400,300);
popMatrix();
pushMatrix();
translate(w,h/2-sin(i+10)*400/2,(-w/3)*dst);
box(300,1000+sin(i+10)*400,300);
popMatrix();
}
if (dst < amm) {
windows(rot+PI/4, dst+1, (i+1)%17);
}
}
1