Heh, please not 'outside' (at least yet) - we are having a big kerfuffle over in the C3 community with Ashley about that. No need to add fuel to the fire 🙂
Some good-ish news though, he came back with this proposal, no vertex color, but drawMesh() with possibilities for future improvements, any changes needed for parameters, etc.? I'm going to look at 3DObject also and see what it might need (beyond vertex color for now.)
"Tell you what - it makes sense to do the emulation inside Construct's own renderer where it's probably a bit faster, and it's fairly easy to write. So the next beta has a drawMesh(posArr, uvArr, indexArr) method, where:
posArr is array of [x, y, z]
uvArr is array of [u, v]
indexArr is array of [i, j, k], so each entry corresponds to rendering a single triangle
For example in the drawingPlugin sample you can replace the call to renderer.quad3(quad, rcTex) with this and it renders the texture twice with a skew:
const posArr = [
[quad.p1.x + 50, quad.p1.y, 0],
[quad.p2.x + 50, quad.p2.y, 0],
[quad.p3.x, quad.p3.y, 0],
[quad.p4.x, quad.p4.y, 0],
[quad.p1.x + 250, quad.p1.y, 0],
[quad.p2.x + 250, quad.p2.y, 0],
[quad.p3.x + 200, quad.p3.y, 0],
[quad.p4.x + 200, quad.p4.y, 0]
];
const uvArr = [
[rcTex.left, rcTex.top],
[rcTex.right, rcTex.top],
[rcTex.right, rcTex.bottom],
[rcTex.left, rcTex.bottom],
[rcTex.left, rcTex.top],
[rcTex.right, rcTex.top],
[rcTex.right, rcTex.bottom],
[rcTex.left, rcTex.bottom]
];;
const indexArr = [
[0, 1, 2],
[0, 2, 3],
[4, 5, 6],
[4, 6, 7],
];
renderer.drawMesh(posArr, uvArr, indexArr);
It doesn't do per-vertex colors, since as discussed it would take more work to do that, but it can do the textured mesh drawing, including in 3D; colors could be added in future. As it moves the implementation to Construct's own renderer, any future optimizations can be done as an internal change and addons won't need changing. It also gives us scope to do something like proper mesh submission in the WebGPU renderer only while leaving WebGL with an emulated implementation, to be ultimately phased out. So hopefully that's at least a bit of an improvement on the current situation."