# Alternative to background()

**URL:** <https://discourse.processing.org/t/alternative-to-background/35923>\
**Category:** Coding Questions\
**Created:** [March 24, 2022, 2:11pm UTC](https://discourse.processing.org/t/alternative-to-background/35923 "2022-03-24T14:11:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raul](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@Raul](https://discourse.processing.org/u/Raul)\
**Post date:** [March 24, 2022, 2:11pm UTC](https://discourse.processing.org/t/alternative-to-background/35923/1 "2022-03-24T14:11:14Z")

</div>

Hi there,

It would be long to explain, but I can’t use background() in my sketch (something related with P3D sketches whose windows are bigger than your display).

So, I though this code would do the same as background(0)

```auto
  loadPixels();  
  for (int x = 0; x < width; x++) {
    for (int y = 0; y < height; y++) {
      int loc = x + y * width;
      pixels[loc] = color(0);
    }
  }
  updatePixels();

```

In fact, this code works. There is just something a little weird: my NVIDIA Antialiasing -Gamma Correction option doesn’t work.

So, if you run the following code in a NVIDIA video card, the visual result is the same with Antialiasing - Gamma Correction On or Off. The antialising gamma correction doesn’t do anything. Very weird.

```auto
int z = 0;
int w = 800;
int h = 600;

void settings() {
  size(w, h, P3D);
}

void setup() {
  stroke(255);
}

void draw() {
  //background(0);

  loadPixels();  
  for (int x = 0; x < width; x++) {
    for (int y = 0; y < height; y++) {
      int loc = x + y * width;
      pixels[loc] = color(0);
    }
  }
  updatePixels();

  pushMatrix();
  translate(0, 0, z);

  for (int i = 0; i <100; i++) {
    line(0, 100+2*i, w, 100+2*i);
  }
  popMatrix();
  z = z -10;
  saveFrame("frame-###.png");
}

```

Any idea? Any other alternative to background(0). I have tried several things. Nothing works.

Thanks!
