Search code examples
c++openglglslglm-math

How to avoid pixelated geometry while using a moving camera with perspective view?


While I move the camera, the pixels of the geometry are moving as well.

Pixelated Geometry

For perspective projection I use

glm::perspective( 45.0f, float( screenWidth ) / float( screenHeight ), 1.0f, 140.0f );

I draw the cubes per side.

This seems like an easy question. Should I set the resolution higher somewhere?


Solution

  • As Bartek Banachewicz commented, enabling Anti Aliasing in OpenGL fixed the issue.

    I am using MSAA for Anti Aliasing.

    https://www.opengl.org/wiki/Multisampling