Results 1 to 2 of 2

Thread: Shader Example Using GPU/Texture Data Storage

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    5

    Shader Example Using GPU/Texture Data Storage

    I'm taking a graphics class (Ed Angel's book) and have thus far used only simple shaders. I want to expand into more complicated shaders that actually store most of the data they need on the GPU rather than updating that data from the CPU each frame. This particular program is an agent based model with thousands of triangles moving on a grid.

    Thus I want to store data in the shader that changes each time through the DrawArrays pipeline. I believe I will only need two ARRAY_BUFFERs. One would be thousands of identical triangles at the origin pointing "up". The other would be integer indices into the on-GPU storage which contains position and heading, and each DrawArrays calculates new values for that data.

    So my first "hello shader" will store on-GPU the position and heading of the many triangles, and update those values each time DrawArrays is run.

    I know that I can store arrays of floats etc, and even structs in the shader. I'm told, however, it might be better to use texture memory.

    So my post is to find an example of such a stunt, or pointers/suggestions as to how to do this.

    -- Owen

  2. #2
    Junior Member
    Join Date
    Dec 2011
    Posts
    3

    Re: Shader Example Using GPU/Texture Data Storage

    Hi backspaces,

    Did you ever find an explanation of how to do this? I suspect it's going to be part of the solution to my problem as well.


    Many thanks.

Similar Threads

  1. Positional data in pixel shader
    By mrflibble in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 3
    Last Post: 01-20-2013, 02:30 PM
  2. Persistent storage on opencl GPU
    By poonaatsoc in forum OpenCL
    Replies: 3
    Last Post: 07-02-2009, 09:46 AM

Posting Permissions

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