# WEBGL pointLight issue with Graphics buffer

**URL:** <https://discourse.processing.org/t/webgl-pointlight-issue-with-graphics-buffer/5969>\
**Category:** Coding Questions\
**Created:** [November 26, 2018, 7:16pm UTC](https://discourse.processing.org/t/webgl-pointlight-issue-with-graphics-buffer/5969 "2018-11-26T19:16:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![r4nd0m](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/r4nd0m/32/9477_2.png) [@r4nd0m](https://discourse.processing.org/u/r4nd0m)\
**Post date:** [November 26, 2018, 7:16pm UTC](https://discourse.processing.org/t/webgl-pointlight-issue-with-graphics-buffer/5969/1 "2018-11-26T19:16:34Z")

</div>

Hi, does anyone know why the light source in this example is not changing position?  
Thanks!

```auto
let gl;
let offsetX = 0;
function setup() {
  createCanvas(400, 400);
	gl = createGraphics(100, 100, WEBGL);
}

function draw() {
		background(0);
        gl.background(0);
		gl.pointLight(255, 255, 255, -100+offsetX, -100, 20);
		gl.plane(100, 100);
		gl.normalMaterial()
		image(gl, 200, 200)
		offsetX++;
}

```

Here is live example [https://editor.p5js.org/r4nd0m\_jump/sketches/BJBPHpYCQ](https://editor.p5js.org/r4nd0m_jump/sketches/BJBPHpYCQ)

---

<div class="post-metadata">

**Author:** ![r4nd0m](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/r4nd0m/32/9477_2.png) [@r4nd0m](https://discourse.processing.org/u/r4nd0m)\
**Post date:** [November 27, 2018, 4:04pm UTC](https://discourse.processing.org/t/webgl-pointlight-issue-with-graphics-buffer/5969/2 "2018-11-27T16:04:57Z")

</div>

Ok, so after inspecting p5 github repo, I concluded that calling

```auto
gl._renderer._update();

```

at the and of `draw` function solves the problem.  
But I’m not familiar with lifecycle, and why this doesn’t work with `gl = createGraphics()`??
