# Mapping n-dimensional data arrays to vertex attributes

**URL:** https://discourse.vtk.org/t/mapping-n-dimensional-data-arrays-to-vertex-attributes/8301
**Category:** Support
**Created:** [April 14, 2022, 6:12pm UTC](https://discourse.vtk.org/t/mapping-n-dimensional-data-arrays-to-vertex-attributes/8301 "2022-04-14T18:12:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![guaje](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/85f322/32.png) [@guaje](https://discourse.vtk.org/u/guaje)
#### Post date: [April 14, 2022, 6:12pm UTC](https://discourse.vtk.org/t/mapping-n-dimensional-data-arrays-to-vertex-attributes/8301/1 "2022-04-14T18:12:30Z")

</div>

Hello,

I’m trying to map n-dimensional per-point data to per-vertex data using the `MapDataArrayToVertexAttribute` function.

In the past, I have succeeded in mapping integers, floats, and vec3/4 using this function and then adding shaders replacements using the respective function (`AddShaderReplacement`) and retrieving the appropriate data type. However, with n-dimensional arrays, the information that I’m getting in the vertex shader does not match my information in the polydata.

Here is how I get the data array in the vertex shader declaration in case that’s the problem.

`in float data[dim];`

If that’s the problem, what is the right way to retrieve the per-vertex data?

Thanks in advance.
