sample code for testing
var s = function(p) {
p.setup = function() {
p.createCanvas(200, 200, p.WEBGL);
p.background(0);
}
}
new p5(s);
var s2 = function(p) {
p.setup = function() {
p.createCanvas(200, 200, p.WEBGL);
p.background(200);
}
}
new p5(s2);
I think this could be part of the problem:
https://github.com/processing/p5.js/blob/master/src/core/rendering.js#L55
I'm currently looking into auto-incrementing the id per instance, related to this issue: #965