Help with lights and best material

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?

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?

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/

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

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


…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.

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.

Maybe related

1 Like

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)

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:

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:

Or you could add two DirectionalLights from opposite directions:

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.