Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Three.js - Getting the low poly look

I'm trying to generate some terrain in the low poly style, for reference, this kind of style:

What I mean by this is each triangle is one shade.

When I attempt something like this, the shading is very smooth. Here's an example with only a few triangles:


(source: willdonohoe.com)

I also tried adding shadows, but this didn't create the desired effect either. Here's a shot with more triangles with added shadows:


(source: willdonohoe.com)

Looking through the Three documentation, the shading property on the materials class sounds like it would do the trick, but THREE.FlatShading and THREE.NoShading doesn't seem to have any effect.

Is there a special technique that I need to use create this effect? Any direction you can point my way would be much appreciated.

You can find my first demo here

Many thanks,

Will

like image 601
WillDonohoe Avatar asked Jan 10 '23 23:01

WillDonohoe


1 Answers

EDIT: This answer was outdated. Updating:

material.shading = THREE.FlatShading is now material.flatShading = true.

You modified the vertex positions of your PlaneGeometry.

To generate flat shading with MeshLambertMaterial, you must update your normals by calling

geometry.computeFlatVertexNormals();

For other materials, simply setting material.flatShading = true is sufficient to get the flat look.

three.js r.87

like image 197
WestLangley Avatar answered Jan 18 '23 06:01

WestLangley