Problem with "jaggy" edges

As you can see on the picture, somtimes some edges are shown strangely. Does somebody know what's the reason for this mess? In the OCC samples there's no such problem. It doesn't matter if antialiasing of the view is on or off. I have seen this artifact on at least 3-4 different machines with different video cards. I'm with OCC 6.2.1, but it was the same with version 5 in the past.


Svetlozar Kostadinov's picture

Please, somebody help!

Svetlozar Kostadinov's picture

I've found the cause of the problem - a call to V3d_View::SetZSize(1000000);
When I commented it - everything is rendered fine.

m-aronsson's picture

It is an OpenGL problem, most OpenGL hardware has a very limited depth buffer resolution (16 bits for example) and this is not linear so you loose resolution with distance, the far clipping plane is not that important, the important value to set is the near clipping plane because it has highest impact on the resolution, but setting the far clipping plane closer also works.