# Texture with P2D renderer?

**URL:** <https://discourse.processing.org/t/texture-with-p2d-renderer/22148>\
**Category:** Coding Questions\
**Created:** [June 25, 2020, 12:29am UTC](https://discourse.processing.org/t/texture-with-p2d-renderer/22148 "2020-06-25T00:29:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grege2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/grege2/32/3069_2.png) [@grege2](https://discourse.processing.org/u/grege2)\
**Post date:** [June 25, 2020, 12:29am UTC](https://discourse.processing.org/t/texture-with-p2d-renderer/22148/1 "2020-06-25T00:29:59Z")

</div>

Hi,  
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.

> **[What have you tried? - Matt Gemmell](https://mattgemmell.com/what-have-you-tried/)**
>
> How to properly ask technical questions, and demonstrate that you've done your research and are willing to learn on your own.

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.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 25, 2020, 4:36am UTC](https://discourse.processing.org/t/texture-with-p2d-renderer/22148/2 "2020-06-25T04:36:57Z")

</div>

> [@grege2](#):
>
> , but I’m seeking work-arounds.

Well, we can have WEBGL [**createGraphics()**](https://p5js.org/reference/#/p5/createGraphics) on a P2D [**createCanvas()**](https://p5js.org/reference/#/p5/createCanvas), and vice-versa. 💡

Although I guess WEBGL [p5.Graphics](https://p5js.org/reference/#/p5.Graphics) still aren’t 100% bug-free. 🐛

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

---

<div class="post-metadata">

**Author:** ![grege2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/grege2/32/3069_2.png) [@grege2](https://discourse.processing.org/u/grege2)\
**Post date:** [June 25, 2020, 8:04pm UTC](https://discourse.processing.org/t/texture-with-p2d-renderer/22148/3 "2020-06-25T20:04:35Z")

</div>

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