# Help with lights and best material

**URL:** <https://discourse.threejs.org/t/help-with-lights-and-best-material/9895>\
**Category:** Questions\
**Tags:** materials, geometry\
**Created:** [September 26, 2019, 6:44pm UTC](https://discourse.threejs.org/t/help-with-lights-and-best-material/9895 "2019-09-26T18:44:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vitorkrau](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/vitorkrau/32/6450_2.png) [@vitorkrau](https://discourse.threejs.org/u/vitorkrau)\
**Post date:** [September 26, 2019, 6:44pm UTC](https://discourse.threejs.org/t/help-with-lights-and-best-material/9895/1 "2019-09-26T18:44:14Z")

</div>

I’m trying to do two things and I need some help and advice. First, Anyone know what is the best material two use on engineer models (like ships, planes, oil platforms)? Also, I’m trying to disable shadows of these models but I don’t how to do it. I tried the castShadow option, tried to put directional lights from everywhere, to have the light following the camera and every time a part of the model is with shadows.

Any help on that?

---

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [September 26, 2019, 7:19pm UTC](https://discourse.threejs.org/t/help-with-lights-and-best-material/9895/2 "2019-09-26T19:19:19Z")

</div>

Do you have a working example of your code? Shadows don’t just show up automatically. You have to enable them and a lot of moving parts have to come together for them to work, so it’s hard to imagine how you can’t disable them. Are you working with someone else’s code?

---

<div class="post-metadata">

**Author:** ![vitorkrau](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/vitorkrau/32/6450_2.png) [@vitorkrau](https://discourse.threejs.org/u/vitorkrau)\
**Post date:** [September 26, 2019, 7:33pm UTC](https://discourse.threejs.org/t/help-with-lights-and-best-material/9895/3 "2019-09-26T19:33:46Z")

</div>

I have a webpage running a test model which I can’t send you but there you can access the code through the console and see what I’m trying to say.

[https://vitorkrau.github.io/tecgraf/](https://vitorkrau.github.io/tecgraf/)

Note that the bottom of the model is black and the rest is “solid green”.

---

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [September 26, 2019, 7:52pm UTC](https://discourse.threejs.org/t/help-with-lights-and-best-material/9895/4 "2019-09-26T19:52:40Z")

</div>

Ah, I see… your problem isn’t with shadows, but with your geometry’s normals.  
Looking at this cube…

 ![04%20PM](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/2/21506066831d3b6bf6417185af60d396ec299651.png)  
…you can see that it’s blending all faces smoothly from one to the other. This is because the faces are sharing a vertex where they meet.

You probably want hard edges so it feels like one face is looking up, one forward, and one to the side. You can achieve this by giving each face a unique set of vertices without sharing them with adjacent faces. This needs to happen in your 3D modeling software, before it gets exported. All 3D programs have an ability to make sharp or smooth edges. [See this discussion for how to achieve this in Blender](https://blender.stackexchange.com/questions/734/how-to-smooth-shade-an-object-while-retaining-hard-edges/2799).

---

<div class="post-metadata">

**Author:** ![vitorkrau](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/vitorkrau/32/6450_2.png) [@vitorkrau](https://discourse.threejs.org/u/vitorkrau)\
**Post date:** [September 26, 2019, 8:16pm UTC](https://discourse.threejs.org/t/help-with-lights-and-best-material/9895/5 "2019-09-26T20:16:05Z")

</div>

Actually, the model is like this. I talked to the guy who did it and he confirmed. In a software my company develop they use a light that follows the camera and this probably will help me a lot. Any ideas on how to do it?

Thanks.

---

<div class="post-metadata">

**Author:** ![felixmariotto](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/felixmariotto/32/5928_2.png) [@felixmariotto](https://discourse.threejs.org/u/felixmariotto)\
**Post date:** [September 26, 2019, 11:52pm UTC](https://discourse.threejs.org/t/help-with-lights-and-best-material/9895/6 "2019-09-26T23:52:31Z")

</div>

Maybe [related](https://discourse.threejs.org/t/why-a-flatshading-true-dosent-work/3259)

---

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [September 27, 2019, 6:50am UTC](https://discourse.threejs.org/t/help-with-lights-and-best-material/9895/7 "2019-09-27T06:50:27Z")

</div>

> [@vitorkrau](#):
>
> I talked to the guy who did it and he confirmed.

Well I don’t believe his normals are being exported correctly, even if they look fine on the 3D editing software. I’ve never dealt with a Nexus loader or `.nxz` files (is this something you built yourself?), but the normals that are being exported are getting merged across faces. However, you could force **all** faces to be flat by setting a **Phong** material with the following parameters (`LambertMaterial` won’t work, as explained in @felixmariotto’s link)

```javascript
material = new THREE.MeshPhongMaterial({
    color: 0xdddddd,
    flatShading: true
});

```

and instead of using a `HemisphereLight`, you should use a `DirectionalLight` with an uneven position on each axis so each face gets a different amount of light:

```javascript
var light = new THREE.DirectionalLight(0xffffff, 0.5);
light.position.set(0.3, 0.7, 1.0)
scene.add(light);

```

Here’s the result with those modifications:

 ![30%20PM](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/6/6025deded6dc57975ea63867211525dc5ada0279.png)

Or you could add two `DirectionalLight`s from opposite directions:

 ![07%20AM](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/c/c41e800c80778ce4e65c521620928a738a61f19a.png)

Ideally, the rounded lamps wouldn’t be so faceted, but you’re forcing all faces to be flat with `flatShading: true`, since you can’t modify the normals coming out of your exported file.
