# How to use a raw WebGLTexture object in three.js?

**URL:** <https://discourse.threejs.org/t/how-to-use-a-raw-webgltexture-object-in-three-js/53910>\
**Category:** Questions\
**Tags:** webxr, textures, shaders\
**Created:** [July 14, 2023, 1:33pm UTC](https://discourse.threejs.org/t/how-to-use-a-raw-webgltexture-object-in-three-js/53910 "2023-07-14T13:33:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcofugaro](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marcofugaro/32/9865_2.png) [@marcofugaro](https://discourse.threejs.org/u/marcofugaro)\
**Post date:** [July 14, 2023, 1:33pm UTC](https://discourse.threejs.org/t/how-to-use-a-raw-webgltexture-object-in-three-js/53910/1 "2023-07-14T13:33:24Z")

</div>

I am trying to use the [WebXR Camera Access API](https://github.com/immersive-web/raw-camera-access/blob/3ae268a6889ddd7380bce96964a9bc977d99460d/explainer.md), where the api just returns a WebGLTexture:

```js
const cameraTexture = binding.getCameraImage(view.camera); // --> WebGLTexture

```

However I am not sure how to use a WebGLTexture already uploaded to the GPU with three.js.

I could [read the pixel values using the `readPixels` function](https://stackoverflow.com/questions/13626606/read-pixels-from-a-webgl-texture), but is there a better way which doesn’t involve passing the data back to the CPU?
