# How to apply two textures to the same PShape?

**URL:** <https://discourse.processing.org/t/how-to-apply-two-textures-to-the-same-pshape/5971>\
**Category:** Coding Questions\
**Created:** [November 26, 2018, 7:35pm UTC](https://discourse.processing.org/t/how-to-apply-two-textures-to-the-same-pshape/5971 "2018-11-26T19:35:34Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [May 29, 2019, 8:53pm UTC](https://discourse.processing.org/t/how-to-apply-two-textures-to-the-same-pshape/5971/8 "2019-05-29T20:53:17Z")

</div>

The hint would change the value of `gl_VertexID` if there were more than one shape, as all shapes would be sent in one batch (if I understood it correctly).

> [@PShape::attrib() and PShape::setAttrib() dont work proprely](https://discourse.processing.org/t/pshape-attrib-and-pshape-setattrib-dont-work-proprely/845):
>
> the attrib() and setAttrib() do not work proprely in all scenarios The only way it works is when using attrib() in a not GROUP PShape. Here is a working Exemple : // // Working Exemple // PShape shape; PShader shader; public void setup() { size(500, 500, P2D); shape = createShape(); shape.beginShape(); // Visual shape.noStroke(); shape.fill(255, 0, 0); // Not supposed to be Red // Custom Attribute shape.attrib("vert\_color", 1.0, 0.5, 0.0, 1.0); // Supposed to be Or…

---

_[View the full topic](https://discourse.processing.org/t/how-to-apply-two-textures-to-the-same-pshape/5971)._
