# How use a 2D array in VTK to produce a 2D texture

**URL:** https://discourse.vtk.org/t/how-use-a-2d-array-in-vtk-to-produce-a-2d-texture/4701
**Category:** Support
**Created:** [November 20, 2020, 1:33pm UTC](https://discourse.vtk.org/t/how-use-a-2d-array-in-vtk-to-produce-a-2d-texture/4701 "2020-11-20T13:33:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jone7](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/e36b37/32.png) [@Jone7](https://discourse.vtk.org/u/Jone7)
#### Post date: [November 20, 2020, 1:33pm UTC](https://discourse.vtk.org/t/how-use-a-2d-array-in-vtk-to-produce-a-2d-texture/4701/1 "2020-11-20T13:33:31Z")

</div>

I want to convert an array into a 2D texture and pass it into shader’s uniform sampler2D variable.  
Is there any good way?

---

<div class="post-metadata">

### Author: ![Jone7](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/e36b37/32.png) [@Jone7](https://discourse.vtk.org/u/Jone7)
#### Post date: [November 21, 2020, 1:28am UTC](https://discourse.vtk.org/t/how-use-a-2d-array-in-vtk-to-produce-a-2d-texture/4701/2 "2020-11-21T01:28:18Z")

</div>

Is there uniform sampler2D S with vtkTexture to achieve texture generation?
