Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Update 3D Texture inside GPU

  1. #1
    Intern Newbie
    Join Date
    Sep 2006
    Posts
    37

    Update 3D Texture inside GPU

    Hi,

    Is it possible to update the values of a 3D texture with values that I have in another 2D texture (all the process inside the GPU)?

    I know how to update values of a 2D texture, for example using FBO color attachment, but not for 3D texture.

    Any suggestions? Thanks!

  2. #2
    Junior Member Regular Contributor
    Join Date
    Aug 2001
    Posts
    145

    Re: Update 3D Texture inside GPU

    Well, afaik not yet. Rendering into a 3d texture can be implemented by using a 'flat 3d texture'. For further information have a look into this paper http://www.markmark.net/cloudsim/ !

  3. #3
    Intern Newbie
    Join Date
    Sep 2006
    Posts
    37

    Re: Update 3D Texture inside GPU

    The problem of using flat 3d texture is the interpolation. I can't use the gpu trilinear interpolation because I have a 2d texture that stores the slices of a 3d texture.

    The fact is that I can't use interpolation, because I will mix values of the border of two slices in the wrong way. So I have to compute the interpolation in a shader.

    What do you think?

  4. #4
    Intern Newbie
    Join Date
    Mar 2005
    Location
    A Coruņa (Spain)
    Posts
    44

    Re: Update 3D Texture inside GPU

    Well, the FBO extension spec includes support to FBO color attachment to each slice. But if you want to update more than one slice using FBO, you'll need MRT, so you could update 4 slices at each step.

    But this is the spec. At implementation this feature would be not supported. I was trying to do that about one year ago with my NVIDIA 5900FX, but I couldn't. I don't know if it was because the hardware, the drivers or both.

    You could try to do that, in one year there are new drivers and new hardware.

    PD: this is one of the faults of FBO in my opinion. FBO must support at least one texture type, texture type, etc configuration. But you haven't got any way to know the supported configuration. Well or at least I don't know it, someone knows?

  5. #5
    Intern Newbie
    Join Date
    Sep 2006
    Posts
    37

    Re: Update 3D Texture inside GPU

    The problem of have a stack of 2D textures to represent the 3D texture is in the rendering, because I can't use the trilinear interpolation that gives OpenGL.

    I want to use 3D textures to exploit this property that the flat 3D textures don't have (they only allow bilinear interpolation). But I need to update the values of the 3D texture between consecutive frames. I have the new values on the GPU, so I want to avoid the transaction between the GPU and CPU.

  6. #6
    Junior Member Regular Contributor
    Join Date
    Aug 2001
    Posts
    145

    Re: Update 3D Texture inside GPU

    In my implementation I'm initializing each slice with a one pixel border with value 0.
    I'm solving partial differential equations in 3d and after each iteration vertical and horizontal lines are rendered to set the border values back to 0.
    For rendering, I'm sampling texel i with its four neighbours and the texel (of same local slice position as texel i) of the slice in the upper and lower row.

  7. #7
    Junior Member Regular Contributor
    Join Date
    Jan 2005
    Location
    Stockholm, Sweden
    Posts
    164

    Re: Update 3D Texture inside GPU

    speed: Why can you not implement trilinear interpolation in your shader as you were talking about earlier? You can even use the bilinear interpolation that OpenGL provides and just do the last dimension. Sure from a cache point-of-view having OpenGL do the whole trilinear would be better, but while we are waiting...

    You can do trilinear for "flat" textures as well. This will be awful for cache though, but it is definately possible.

  8. #8
    Intern Newbie
    Join Date
    Sep 2006
    Posts
    37

    Re: Update 3D Texture inside GPU

    I will do the trilinear in the shader.
    I want a color attachment for 3D textures!!
    I will be waiting for this...

  9. #9
    Member Regular Contributor
    Join Date
    Mar 2001
    Posts
    469

    Re: Update 3D Texture inside GPU

    Using the GeForce 8800 extensions you can select the slice you want to render into in the geometry shader.

  10. #10
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,576

    Re: Update 3D Texture inside GPU

    Can you not use a PBO to copy from the 2D render target, then upload with a glTexSubImage command?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •