Closed
Description
Most appropriate sub-area of p5.js?
- WebGL
p5.js version
1.5.0
Steps to reproduce:
- Version 1.4.2
note the ambient color
https://editor.p5js.org/jwdunn1/sketches/GZTNLHnPd - Version 1.5.0
note the absence of ambient color (it's suddenly a black cube)
https://editor.p5js.org/jwdunn1/sketches/Um5DLsasQ - Version 1.5.0 with fix, now matches 1.4.2
must set the ambientMaterial to 255
https://editor.p5js.org/jwdunn1/sketches/k6Pi7uvtm
Evident here also: p5js.org/reference/#/p5/lights
The ambient lighting is absent, hence the rendering is much darker.
If ambientMaterial() is set to 255, then the gray returns to what we saw prior to 1.5.0
Cause:
Due to PR#5774, the default ambient color is now 0.
Line 98 in src/webgl/p5.RendererGL.js:
this.curAmbientColor = this._cachedFillStyle = [0, 0, 0, 0];
Potentially repaired by setting this to be [1,1,1,1]
This would match both v1.4.2 and Processing 4.0.1
Snippet:
// is this now required in order to match 1.4.2?
ambientMaterial(255);