# I get black using meshNormalMaterial with bufferGeometry

**URL:** https://discourse.threejs.org/t/i-get-black-using-meshnormalmaterial-with-buffergeometry/25629
**Category:** Questions
**Tags:** geometry, materials
**Created:** [April 23, 2021, 4:07pm UTC](https://discourse.threejs.org/t/i-get-black-using-meshnormalmaterial-with-buffergeometry/25629 "2021-04-23T16:07:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dcromley](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/dcromley/32/9997_2.png) [@dcromley](https://discourse.threejs.org/u/dcromley)
#### Post date: [April 23, 2021, 4:07pm UTC](https://discourse.threejs.org/t/i-get-black-using-meshnormalmaterial-with-buffergeometry/25629/1 "2021-04-23T16:07:29Z")

</div>

Why do I get black using meshNormalMaterial with this bufferGeometry?

> ```
> "use strict";
> let scene, camera, renderer, geometry, material, mesh;
> scene = new THREE.Scene();
> camera = new THREE.PerspectiveCamera( 40, 800/600, 1, 10 );
> camera.position.z = 5;
> renderer = new THREE.WebGLRenderer();
> renderer.setSize( 800, 600 );
> renderer.setClearColor(0xcccccc);
> document.body.appendChild( renderer.domElement );
> 
> let apositions = [ rand1(), rand1(), rand1(), // three vertices,
> rand1(), rand1(), rand1(), // one triangle
> rand1(), rand1(), rand1() ];
> geometry = new THREE.BufferGeometry();
> geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( apositions, 3 ) );
> material = new THREE.MeshNormalMaterial( { side:THREE.DoubleSide } );
> mesh = new THREE.Mesh( geometry, material );
> scene.add(mesh);
> 
> renderer.render( scene, camera );
>   
> function rand1() { // between -1 and 1
> return 2*Math.random()-1;
> }
> 
> ```

---

<div class="post-metadata">

### Author: ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)
#### Post date: [April 23, 2021, 4:47pm UTC](https://discourse.threejs.org/t/i-get-black-using-meshnormalmaterial-with-buffergeometry/25629/2 "2021-04-23T16:47:54Z")

</div>

You need normals

```javascript
.computeVertexNormals( );

```

---

<div class="post-metadata">

### Author: ![dcromley](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/dcromley/32/9997_2.png) [@dcromley](https://discourse.threejs.org/u/dcromley)
#### Post date: [April 23, 2021, 5:04pm UTC](https://discourse.threejs.org/t/i-get-black-using-meshnormalmaterial-with-buffergeometry/25629/3 "2021-04-23T17:04:07Z")

</div>

{ thumb up } thanks
