0

I'm reworking my terrain renderer, now it uses gpu tessellation with shaders, with a projected grid style approach: grid centered the and positioned around the camera by finding the nearest gridpoint behind it, at making it as the center.(skytiger's approach a bit reworked) It runs well until I turn off the "reposition method", and go to the edge of the grid.

Since the tessellation algorithm is under testing, I use a simple distance from camera type tessellation, the outer tess factors are depend on the distance of the edge center points from the camera, and the inner from the quad patch center point from the camera. When I move around I runs pretty well, but when I'm near the edge of the grid, in my case at (0,0,0) I get a terrible lagg.

I use VBOs, VAO, heightmap sampler in tessellation shader, no frustum culling(yet), no tessellation culling out of screen(yet), my map width is 2^n*GRIDSCALE, n and GRIDSCALE depends on the frustum. I tested it with map of 8192*8192. The average fps with camera unlocked(not centered) is about 60-70, but around P(0,0,0) its 8-15.

I rendered the whole test grid without cpu LOD, only with gpu tessellation.

What could possibly cause this?

EDIT: I encountered this kind of lag when I made my first ever heightmap, it was the simple static grid with triangle strips with VBO and index array. When I moved the camera to the center of the map, (it was not (0,0,0)) or the upper half in the 'z' axis in the 'z-' direction, and looked down the 'z+' axis I got the lag.

enter image description here

This is the laggy point of view. Around (0,0,0). Elsewhere it runs smooth.

EDIT: Point isn't at (0,0,0), I just didn't take into account the vertex shader transform, so the terrain quad center is (0,0,0) and the bottom right corner is (+MAPWIDTH,0,+MAPWIDTH)(the corner in the pic) At the other corners there is not any lagg.

David Szalai
  • 2,363
  • 28
  • 47
  • Could you include a screenshot of your situation, preferably including a wireframe or point cloud? If this only happens from certain locations it could be due to clipping performance, overdraw, etc... without seeing the actual geometry you are dealing with it is impossible to say. – Andon M. Coleman Nov 01 '13 at 23:30
  • Have you checked how many triangles are being rendered? Besides the obvious having to draw more, this could be caused by inefficiencies in your code in certain situations (if it's rendering roughly the same number of triangles from this angle, you should suspect that). Also, wireframe rendering is slower than surface rendering. – Dave Nov 02 '13 at 09:47
  • Also also, your far away mesh looks very detailed; the triangles should have about the same screen-size as the near triangles. Maybe your lowest LOD is still too detailed? – Dave Nov 02 '13 at 09:49
  • Yeah, I still don't use the right LOD system. The lag happens in solid rendering mode too, and for the triangle count: it should be laggy from every corner because I see the same triangle count from the other corners too. – David Szalai Nov 02 '13 at 10:02
  • I've just tested it on a plane without displacement, and the same happens. The plane is 2048*2048, uniform grid (16*16 quads) with distance dependent tessellation(patch center - camera). The right bottom corner causes the laggs, and it is not depend on the view direction. – David Szalai Nov 02 '13 at 10:12

0 Answers0