Skip to content

Commit 0f577f1

Browse files
authored
Merge pull request #5555 from aferriss/webgl-alpha-false
Changes webGL alpha buffer to false.
2 parents ef17670 + 43d8fa8 commit 0f577f1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/webgl/p5.RendererGL.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ p5.RendererGL.prototype._setAttributeDefaults = function(pInst) {
235235
// See issue #3850, safer to enable AA in Safari
236236
const applyAA = navigator.userAgent.toLowerCase().includes('safari');
237237
const defaults = {
238-
alpha: true,
238+
alpha: false,
239239
depth: true,
240240
stencil: true,
241241
antialias: applyAA,
@@ -345,7 +345,7 @@ p5.RendererGL.prototype._resetContext = function(options, callback) {
345345
* The available attributes are:
346346
* <br>
347347
* alpha - indicates if the canvas contains an alpha buffer
348-
* default is true
348+
* default is false
349349
*
350350
* depth - indicates whether the drawing buffer has a depth buffer
351351
* of at least 16 bits - default is true

test/unit/webgl/p5.RendererGL.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ suite('p5.RendererGL', function() {
333333
pg.clear();
334334
myp5.image(pg, -myp5.width / 2, -myp5.height / 2);
335335
pixel = myp5.get(0, 0);
336-
assert.deepEqual(pixel, [0, 255, 255, 255]);
336+
assert.deepEqual(pixel, [0, 0, 0, 255]);
337337
done();
338338
});
339339

@@ -356,7 +356,7 @@ suite('p5.RendererGL', function() {
356356
pg.background(100, 100, 100, 100);
357357
myp5.image(pg, -myp5.width / 2, -myp5.height / 2);
358358
pixel = myp5.get(0, 0);
359-
assert.deepEqual(pixel, [39, 194, 194, 194]);
359+
assert.deepEqual(pixel, [100, 100, 100, 255]);
360360
done();
361361
});
362362

@@ -378,7 +378,7 @@ suite('p5.RendererGL', function() {
378378
pg.clear();
379379
myp5.image(pg, 0, 0);
380380
pixel = myp5.get(0, 0);
381-
assert.deepEqual(pixel, [0, 255, 255, 255]);
381+
assert.deepEqual(pixel, [0, 0, 0, 255]);
382382
done();
383383
});
384384

@@ -389,7 +389,7 @@ suite('p5.RendererGL', function() {
389389
pg.background(100, 100, 100, 100);
390390
myp5.image(pg, 0, 0);
391391
pixel = myp5.get(0, 0);
392-
assert.deepEqual(pixel, [39, 194, 194, 255]);
392+
assert.deepEqual(pixel, [100, 100, 100, 255]);
393393
done();
394394
});
395395
});
@@ -437,8 +437,8 @@ suite('p5.RendererGL', function() {
437437
test('blendModes change pixel colors as expected', function(done) {
438438
myp5.createCanvas(10, 10, myp5.WEBGL);
439439
myp5.noStroke();
440-
assert.deepEqual([133, 69, 191, 158], mixAndReturn(myp5.ADD, 255));
441-
assert.deepEqual([0, 0, 255, 122], mixAndReturn(myp5.REPLACE, 255));
440+
assert.deepEqual([133, 69, 191, 255], mixAndReturn(myp5.ADD, 255));
441+
assert.deepEqual([0, 0, 255, 255], mixAndReturn(myp5.REPLACE, 255));
442442
assert.deepEqual([133, 255, 133, 255], mixAndReturn(myp5.SUBTRACT, 255));
443443
assert.deepEqual([255, 0, 255, 255], mixAndReturn(myp5.SCREEN, 0));
444444
assert.deepEqual([0, 255, 0, 255], mixAndReturn(myp5.EXCLUSION, 255));

0 commit comments

Comments
 (0)