Search code examples
opengl3dvisualizationcubepoints

Reduce negative perceptual effects when rendering a 3D cube filled with points with OpenGL


I need to render a simple 3D cube with OpenGL filled with points that lie on a regular 64x64x64 grid. An image can be found here.

It's hard to explain, but obviously there are some perceptual difficulties due to the projection from 3d to 2d. I tried to displace the points by an randomly generated offset, which helped a little bit, but wasn't really satisfying.

I think there's even a name for that effect, but I couldn't find it, so it would be great if someone could name it and maybe give some advide to reduce it.


Solution

  • You might be thinking of Moiré patterns. MSAA (multi-sample anti-aliasing) might help, or perhaps the introduction of jitter. See also: Supersampling

    Alternatively, you could draw the points using point sprites or billboarding, which can be implemented very efficiently using modern (GL) geometry shaders.