Вопрос

I try to render terrain using data from here. Each file contains 1x1 square. In each square there is 1201 * 1201 points (altitudes).

Unfortunately I've got a huge issue with performance. While rendering about 100 000 points fps ~ 30, while rendering full square there is about 0.5 - 3.0 fps... tragedy...

I've spent full 5 days on it and I have no I idea how could I speed up it. Is it too much for a graphic card or maybe it is something with my drivers? I've checked it on two computers, but on each I've got radeon HD. My desktop computer is really good - 4 cores, 8GB RAM, radeon HD 4850 1GB, SSD, so it's not because of an old hardware.

Do you have any ideas? Maybe I should switch some option in driver/opengl?

I do really basic things:

GLenum mode = GL_TRIANGLE_STRIP;

glBindVertexArray(_vao);

//pass data
glUniformMatrix4fv(_mvp_loc, 1, GL_FALSE, &mvp[0][0]);  
glUniform2f(_part_pos_loc, _longitude, _latitude);

//draw
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, DETAILS_LEVEL[levelOfDetails]);
glDrawElements(mode, DETAILS_COUNT[levelOfDetails], GL_UNSIGNED_INT, (void*)0);

glBindVertexArray(0);

My vertex shader is also quite simple.

Это было полезно?

Решение

I've resolved the problem (after a couple of days on it)!
I hope that my answer will save someone's day :-).

It was caused because of two things:

  • Hyper-V - after disabling it fps increased about 7 times (who would guess, that it can be hyper-v?)
  • GL_SHORT - I used this type for vertex, when I replaced it with GL_FLOAT then fps increased a few times! (probably GL_SHORT caused some conversions)
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top