Results 1 to 3 of 3

Thread: gl_VertexID alternative?

  1. #1
    Junior Member
    Join Date
    Feb 2012

    gl_VertexID alternative?

    Hello, my latest GLES2 shader (iPhone 3GS+) can be highly optimised if it knew which index was being processed. I don't want to send an ID stream as that would be an additional 32bits for the large amount of indices required. I need an alternative to gl_VertexID please, any ideas?

    Also, no logical operations? (var &15) ...seems like things are being restricted somewhere. Are operations on a lowp int expected to be used, as 'ubyte' for example is also missing. TIA.

  2. #2
    Senior Member
    Join Date
    May 2006

    Re: gl_VertexID alternative?

    Unfortunately an ID stream is the only possible alternative, unless your vertices are e.g. arranged as a grid so that you have a simple relation between index and position.

    GLES2 implementations are not actually required to have an integer ALU - all operations allowed with integers can be performed using floating point math.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum |

  3. #3
    Junior Member
    Join Date
    Feb 2012

    Re: gl_VertexID alternative?

    Thanks for clarifying. Looks like you guessed why a vertex ID would have been interesting to me...I was experimenting with voxels. Conclusion: Would now love to see a dedicated voxel chip with *zero* indices per voxel. Initially I thought 2 per voxel (position ID and preset ID), but that doesn't make sense from an editing point of view (though I guess a push to chunk system could work). The only semi-sane VBO I could come up with was slow. So it's back to the nice optimised mesh for me lol, cheers!

    Also yes I've been starting to manually compute the other requirements. Just checking I wasn't reinventing the wheel, certainly at vertex level things are fast enough to perform allsorts of antics

Similar Threads

  1. Depth Texture alternative
    By bram in forum OpenGL ES
    Replies: 0
    Last Post: 10-10-2012, 11:34 AM
  2. glReadPixels() alternative solution?
    By krikit in forum OpenGL ES
    Replies: 4
    Last Post: 04-21-2012, 01:50 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
Proudly hosted by Digital Ocean