# any way to just render a vtkTextureObject in a viewport?

**URL:** <https://discourse.vtk.org/t/any-way-to-just-render-a-vtktextureobject-in-a-viewport/12191>\
**Category:** Support\
**Created:** [August 24, 2023, 2:06am UTC](https://discourse.vtk.org/t/any-way-to-just-render-a-vtktextureobject-in-a-viewport/12191 "2023-08-24T02:06:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpu](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@gpu](https://discourse.vtk.org/u/gpu)\
**Post date:** [August 24, 2023, 2:06am UTC](https://discourse.vtk.org/t/any-way-to-just-render-a-vtktextureobject-in-a-viewport/12191/1 "2023-08-24T02:06:45Z")

</div>

any way to just render a vtkTextureObject in a viewport? the texture is dynamic from another viewport, eg. render the depthBuffer of the main scene in another viewport

---

<div class="post-metadata">

**Author:** ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)\
**Post date:** [August 26, 2023, 3:49pm UTC](https://discourse.vtk.org/t/any-way-to-just-render-a-vtktextureobject-in-a-viewport/12191/2 "2023-08-26T15:49:57Z")

</div>

Hello @gpu

The [vtkOpenGLRenderUtilities](https://vtk.org/doc/nightly/html/classvtkOpenGLRenderUtilities.html) class might offer assistance in this context. However, as I pointed out in your [other question](https://discourse.vtk.org/t/is-there-any-way-to-visualize-float-depthbuffer-in-vtk-copytoframebuffer-seems-cannot-work/12192), it’s significantly more straightforward to debug the depth buffer using developer tools like [Renderdoc](https://renderdoc.org/) rather than attempting to manage it within your code. Debugging depth buffer-related issues can be complex due to the need to handle diverse depth attachment formats, accessing the texture, configuring a sampler for the shader program to render the depth texture, and more.

---

<div class="post-metadata">

**Author:** ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)\
**Post date:** [August 26, 2023, 3:56pm UTC](https://discourse.vtk.org/t/any-way-to-just-render-a-vtktextureobject-in-a-viewport/12191/3 "2023-08-26T15:56:18Z")

</div>

If you happen to already have the depth buffer texture object, then you may be interested in using [vtkOpenGLRenderWindow::TextureDepthBlit (vtkTextureObject\* source, int srcX, int srcY, int srcX2, int srcY2, int destX, int destY, int destX2, int destY2)](https://vtk.org/doc/nightly/html/classvtkOpenGLRenderWindow.html#a50a7763dfb51c94c6cbf6c4b825ff4ec)

---

<div class="post-metadata">

**Author:** ![gpu](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@gpu](https://discourse.vtk.org/u/gpu)\
**Post date:** [August 27, 2023, 2:30am UTC](https://discourse.vtk.org/t/any-way-to-just-render-a-vtktextureobject-in-a-viewport/12191/4 "2023-08-27T02:30:01Z")

</div>

thanks! i treid inherit from vtkRenderPass, but the viewport the pass render into isNot the same as the setting viewport to the render…still working
