# 3D model does not respond to light in instance mode

**URL:** <https://discourse.processing.org/t/3d-model-does-not-respond-to-light-in-instance-mode/42206>\
**Category:** Coding Questions\
**Created:** [June 13, 2023, 9:53am UTC](https://discourse.processing.org/t/3d-model-does-not-respond-to-light-in-instance-mode/42206 "2023-06-13T09:53:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanzor](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@tanzor](https://discourse.processing.org/u/tanzor)\
**Post date:** [June 13, 2023, 9:53am UTC](https://discourse.processing.org/t/3d-model-does-not-respond-to-light-in-instance-mode/42206/1 "2023-06-13T09:53:43Z")

</div>

Hi all,  
When I load my blender-made object into a p5.js sketch in instance mode it does not interact with the light source, but appears as a silhouette. Is this a known limitation? Is there a workaround, assuming I need to run my code in instance mode? Thanks!!  
-Matan

```auto
let sketch = (p) => {

    let box

    p.preload = ()=> {
      box = p.loadModel('img/box.obj'); // I think this can be any file.
    }

    //sketch setup
    p.setup = () => {
      p.createCanvas(window.innerWidth, window.innerHeight, p.WEBGL);
    }

    p.draw = () => {

      p.background(200);
      p.rotateX(p.frameCount * 0.01);
      p.rotateY(p.frameCount * 0.01);
      p.scale(30)
      p.pointLight(250, 250, 250, 0, 0, 50);
      p.ambientMaterial(200,50,50)
      p.noStroke()
      p.model(box);

    }

};

new p5(sketch);

```

---

<div class="post-metadata">

**Author:** ![KumuPaul](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kumupaul/32/13072_2.png) [@KumuPaul](https://discourse.processing.org/u/KumuPaul)\
**Post date:** [June 26, 2023, 9:04am UTC](https://discourse.processing.org/t/3d-model-does-not-respond-to-light-in-instance-mode/42206/2 "2023-06-26T09:04:59Z")

</div>

With p5.js 1.6.0 your code works fine to load a known good model:

https://editor.p5js.org/Kumu-Paul/full/kWP2imxhe

It could be an issue with the actual obj file you are using. If you don’t have good normals set for your vertices that could cause problems with lighting. Also make sure your light source isn’t inside the object. That could result in a lack of correct illumination.
