Texture with P2D renderer?

Is it possible at all, maybe with a hack to directly talk to the browser GL rendering layer, to use simple texturing in the p5.js P2D renderer ? In Java Processing it seems it might be possible in the P2D renderer, the reference pages aren’t quite clear. But I think the Java P2D renderer has nothing to do with the p5.js P2D renderer, it’s just a convenient name which has been kept. Anyway, appreciate any comments.

(Hey, I just stumbled on this, the “author” of What Have You Tried … amusing.

So, I’m ready, hit me with WHYT ! (Answer, the texture() call in p5.js P2D renderer says
“Error: texture() is only supported in WEBGL mode.”
Which it would of course, but I’m seeking work-arounds.

Cheers, GE.

Well, we can have WEBGL createGraphics() on a P2D createCanvas(), and vice-versa. :bulb:

Although I guess WEBGL p5.Graphics still aren’t 100% bug-free. :bug:

Besides having its (0, 0) coordinates in the middle instead of the top-left. :crazy_face:

Thanks @GoToLoop. Doing some texturing in a WEBGL off-screen buffer could help, I’ll have a think.