rendering points

All,

Could someone please explain the following:

Turn off the depth test,
Render a smooth point red with a size of 20,
Render a smooth point blue with a size of 10 in the same location,

The result is a smooth blue point with a size of 10 and no red anywhere.

Is this expected? If so, why does this happen?

thank you,
Robert

  1. Turning off the depth test means that pixels will be drawn to in the order that they’re drawn instead of the order of depth.
  2. Draw a point with anti-aliasing/smoothing that’s red and has a requested width of 20
  3. Draw a point as above, but blue with a smaller width of 10

Because #3 was issued after #2 and we turned off depth testing in #1, the blue point is drawn on top of the red point. There is an implementation-specific maximum point width, so if 10 is the max then the red point will actually only be drawn with a width of 10. This means that all of the blue pixels fall completely on top of the red pixels so you only see the blue point.

So it can be expected, but depending on the computer it may not always be the same (for example the max width might be 5 somewhere).

Also, this is off the top of my head, so if this is for homework, use at your own risk and try to verify the results first.

All,

On a different machine, with an older graphics card, and a smooth point size range of 1 to 64 the result is a blue point with a red ring around it, as I originally expected. I am certain this is not an issue with point size ranges. This is not homework.

Thank you,
Robert

I don’t see how you can be sure that it’s not a problem with point size ranges - they are implementation dependant, so what works on one machine may not work on another. See what glGet( GL.GL_SMOOTH_POINT_SIZE_RANGE ) is.

All,

This is a point size issue… ;D The original graphics card has a range of 1 to 63. Unfortunately the 20 and 10 was just a simple example for discussion, big mistake, I was actually requesting ridiculously large sizes. What confused me the most is that the different machines handled my bad data differently. Lesson learned, thank you all.

Thanks,
Robert