PDA

View Full Version : Correct lines visualization.



Alexanov
03-02-2015, 01:44 AM
Visualization of lines together with shaded surface gave following results:1650

How to improve lines quality?

malexander
03-02-2015, 07:49 AM
Use polygon offset to push the polygons backwards in Z:


glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(2,2);
//draw surfaces
glDisable(GL_POLYGON_OFFSET_FILL);

You can adjust the variable and constant offset amounts sent to glPolygonOffset() to tune it to what works for your scene. I've found that 2,2 works quite well for my application.