# blendMode in 3d space

**URL:** <https://discourse.processing.org/t/blendmode-in-3d-space/11857>\
**Category:** Coding Questions\
**Created:** [June 5, 2019, 11:16am UTC](https://discourse.processing.org/t/blendmode-in-3d-space/11857 "2019-06-05T11:16:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitCrasher](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bitcrasher/32/408_2.png) [@bitCrasher](https://discourse.processing.org/u/bitCrasher)\
**Post date:** [June 5, 2019, 11:16am UTC](https://discourse.processing.org/t/blendmode-in-3d-space/11857/1 "2019-06-05T11:16:22Z")

</div>

hello guys!  
i’ve a problem…i’m try to blend with mode ADD some png images in a 3d space, the problem is that it create artifacts, and transparency of background is removed

```auto
class Particle {
  PVector pos;
  PImage img;
  
  Particle() {
    img = loadImage("reflection.png");
    img.resize(img.width/20, img.height/20);
  }

  void display(PVector pos, float size) {
    this.pos = pos;
    pushMatrix();
    translate(0, 0, pos.z);
    image(img, pos.x, pos.y, size, size);
    popMatrix();
  }
}

```

```auto
import peasy.*;
ParticleSystem ps;
PeasyCam cam;
int numParticles = 2000;

void setup() {
  size(1920, 1080, P3D);
  cam = new PeasyCam(this, 400);
  ps = new ParticleSystem();
}

void draw() {
  tint(#55E4FF);
  translate(-width/2, -height/2);
  background(0);
  blendMode(ADD);
  ps.run();
}

```

this is the piece of code that i use to overlap the image  
is there a work around to avoid this problem?

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [June 7, 2019, 9:31pm UTC](https://discourse.processing.org/t/blendmode-in-3d-space/11857/2 "2019-06-07T21:31:11Z")

</div>

> [@bitCrasher](#):
>
> i’m try to blend with mode ADD some png images in a 3d space

Perhaps blend them with ADD onto a PGraphics buffer, then draw the buffer onto the P3D canvas with image(buffer, x, y) after everything is blended?
