# PShape rendering issue in Android Mode

**URL:** <https://discourse.processing.org/t/pshape-rendering-issue-in-android-mode/36323>\
**Category:** Processing for Android\
**Created:** [April 14, 2022, 1:05am UTC](https://discourse.processing.org/t/pshape-rendering-issue-in-android-mode/36323 "2022-04-14T01:05:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarkMarco](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@DarkMarco](https://discourse.processing.org/u/DarkMarco)\
**Post date:** [April 14, 2022, 1:05am UTC](https://discourse.processing.org/t/pshape-rendering-issue-in-android-mode/36323/1 "2022-04-14T01:05:04Z")

</div>

I’ve been devaloping a mobile game for a while using Processing. While optimising, I discovered a weird problem with PShape rendeing on Android. PShapes created and saved as a variable draw behind everything, whereas ones made on the fly draw correctly. The only way I’ve found to fix this is with resetShader(), but that seems to be a fairly expensive method call, from my testing. Anything know a solution to this?

```
PShape s;

    void setup() {
        s = createShape();
        s.beginShape();
        s.fill(102);
        s.vertex(0, 0);
        s.vertex(200, 0);
        s.vertex(200, 200);
        s.vertex(0, 200);
        s.endShape(CLOSE);
    }

    void draw() {
        translate(width / 2, height / 2);
        background(150);
        fill(255);
        rect(-400, -400, 800, 800);

        // broken shape
        translate(-300, 350);
        //resetShader();
        // the broken shape works if this, resetShader(), is called before it
        // but that only if done after the previous draw call (i.e. rect() above).
        shape(s);

        // working shape
        translate(400, 0);
        beginShape();
        fill(102);
        vertex(0, 0); // top left
        vertex(200, 0); // top right
        vertex(200, 200); // bottom right
        vertex(0, 200); // bottom left
        endShape();

    }
```
