# Adding normal map support to Mesh

<figure><img src="https://3464970502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3JUKGJZ67JX02QZdPhsy%2Fuploads%2F0jhdYi66H0gjowRUJ6F3%2Fimage.png?alt=media&#x26;token=a2e874e4-67dd-4922-b987-d7197cdb8911" alt=""><figcaption></figcaption></figure>

## Add bitangents in struct Vertex

```cpp
struct Vertex {
    glm::vec3 pos;
    glm::vec3 normal;
    glm::vec2 texCoord;
    
    // for normal mapping,  added in LabA08
    // tangent
    glm::vec3 tangent;
    // bitangent
    glm::vec3 bitangent;
};
```

## Add normal map list in Mesh

But we only support one mormal map per mesh.

```cpp
class Mesh {

protected:
    ...

    std::vector<Texture> textures;

    // added in LabA08 
    std::vector<Texture> normals;

    std::vector<GLuint> buffers;

    // this will be Material in the future
    GLuint shaderId;
    
    ...
};
```
