Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Using Textures for Non-Visual Data?

  1. #1
    Intern Newbie
    Join Date
    Jan 2006
    Posts
    30

    Using Textures for Non-Visual Data?

    Hi,

    I'd like to use a texture to store some non-visual data within a scene.

    Firstly, is it possible to apply a texture to a polygon but make it invisible?

    Secondly, is it possible to read the invisible texture data back from the GPU once it's been uploaded?

    I realise that what I'm trying to do can be done by creating a separate data structure within the app. and using that, however I thought using textures might be more efficient. Just wondering if it's possible.

    Cheers,

    Chris

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jul 2005
    Location
    Berlin, Germany
    Posts
    188

    Re: Using Textures for Non-Visual Data?

    Originally posted by cpsmusic:

    I'd like to use a texture to store some non-visual data within a scene.
    Certainly possibly, though depending on your data you might need floating point textures.


    Firstly, is it possible to apply a texture to a polygon but make it invisible?
    Sure, with texture_env_combine or pixel shaders, you can configure the pipeline such that the texture is simply not used. But that seems rather useless. If you don't use the texture, why apply it in the first place?


    Secondly, is it possible to read the invisible texture data back from the GPU once it's been uploaded?


    With Frame Buffer Objects or Pixel Buffer Objects, easily. Without you'd first have to draw the texture to the framebuffer and then read it back via glReadPixels.


    I realise that what I'm trying to do can be done by creating a separate data structure within the app. and using that, however I thought using textures might be more efficient. Just wondering if it's possible.
    If i understand you correctly this sounds like a stupid idea. If you don't need/touch the data on the gpu, how can "upload data, download data unchanged, use data" be any more efficient than simply skipping the first two steps? You'd just be wasting texture memory and upload/download bandwidth.
    355/113 -- Not the famous irrational number PI, but an incredible simulation!

  3. #3
    Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    288

    Re: Using Textures for Non-Visual Data?

    what are you trying to do in the first place ?

    < >
    my wild guess is that it seems like you're trying to extend the "color-ID-picking" approach (rendering primitives with a certain color, reading back the color below a point, and using it as some form of indexing in some database) with something that keeps not only the index, but also the indexed data on the GPU...
    no, it cannot be like this...
    </ >
    Dolo/\/\ightY

  4. #4
    Intern Newbie
    Join Date
    Jan 2006
    Posts
    30

    Re: Using Textures for Non-Visual Data?

    Hi Guys,

    Thanks for the advice. Sorry, but I can't say what I'm trying to do, but trust me, it's not stupid

    Cheers,

    Chris

Posting Permissions

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