Results 1 to 3 of 3

Thread: drawElements with one point

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    11

    drawElements with one point

    I tried to write a unit test that draws a single point with drawElements (obviously, this is not production), and have found that a count of at least 2, not 1, is required for it to render. I see offset and stride requirements in the spec, but nothing related to count.

    For example, the following code doesn't render the point:
    Code :
    var buffer = gl.createBuffer();
    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);
    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 0]), gl.STATIC_DRAW);
    gl.drawElements(gl.POINTS, 1, _gl.UNSIGNED_SHORT, 0);
    But the following drawElements does:
    Code :
    gl.drawElements(gl.POINTS, 2, _gl.UNSIGNED_SHORT, 0);
    No GL errors are given. I tried with both unsigned byte and unsigned short on Chrome and Firefox with a Radeon HD 5870.

    I have an easy workaround for my unit test, but wanted to see if I am missing something obvious.

    Thanks,
    Patrick

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: drawElements with one point

    Sounds like a bug.

    I would do a couple of things:

    1) If possible, try it on different graphics cards...is it just a Radeon driver bug?
    2) Log the bug on both Chrome and Mozilla bug trackers.

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    11

    Re: drawElements with one point

    Looks like I got my cards mixed up. It works with the Radeon, but does not work with an NVIDIA GeFoce 8800 GTS (with updated drivers). I'll see about filing a bug.

    Thanks,
    Patrick

Similar Threads

  1. drawElements with gl.POINTS
    By anvaka in forum Developers Coding:Beginner
    Replies: 1
    Last Post: 05-31-2012, 12:15 PM
  2. drawArrays vs drawElements
    By Achilles4689 in forum WebGL - General
    Replies: 3
    Last Post: 06-20-2011, 06:24 PM

Posting Permissions

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