Optimizing OpenGL rendering Hello! I ran into a poor performance problem when rendering to OpenGL using Assimp. The scene has 266327 triangles. At the same time ~215k is a model of chess. I do not think that the problem is in shaders, because: 128x128 window: 44 (43.7657) FPS, 22.849 ms 256x256 window: 42 (40.9563) FPS, 24.4162 ms 512x512 window: 35 (34.8007) FPS, 28.7351 ms 1024x1024 window: 22 (21.084) FPS, 47.4293 ms But if I don’t draw chess, then in the window 1366x763: 55 (54.8424) FPS, 18.2341 ms Also, changing the resolution of the shadow map does not greatly affect the FPS. There are 2 point light sources on stage, with FPS loss when drawing this model for each of the passes ~10 FPS (from 23 to 55). Ie, there is no difference where I draw this model: in the depth map or in the "color texture". Losses ~ are the same. I load the model with the following parameters: aiProcess_Triangulate | aiProcess_CalcTangentSpace | aiProcess_JoinIdenticalVertices And render as follows: pointer(cs.inPosition, 3, model.shape->meshes[i].getVerticesBuffer()); pointer(cs.inNormal, 3, model.shape->meshes[i].getNormalsBuffer()); pointer(cs.inTangent, 3, model.shape->meshes[i].getTangentsBuffer()); pointer(cs.inBitangent, 3, model.shape->meshes[i].getBitangentsBuffer()); pointer(cs.inTexCoord, 2, model.shape->meshes[i].getTexCoordsBuffer()); if (model.shape->bonesPerVertex != 0) { pointer(cs.inBoneWeights, 4, model.shape->meshes[i].getBoneWeightsBuffer()); pointerui(cs.inBoneIds, 4, model.shape->meshes[i].getBoneIdsBuffer()); } modelMatrix = &model.transformation; updateMatrices(); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, model.shape->meshes[i].getIndicesBuffer()); glDrawElements(GL_TRIANGLES, model.shape->meshes[i].indices.size(), GL_UNSIGNED_INT, nullptr); Here is the scene itself: I will be grateful for the help! https://ift.tt/eA8V8J
Hello! I ran into a poor performance problem when rendering to OpenGL using Assimp. The scene has 266327 triangles. At the same time ~215k is a model of chess. I do not think that the problem is in shaders, because: 128x128 window: 44 (43.7657) FPS, 22.849 ms 256x256 window: 42 (40.9563) FPS, 24.4162 ms 512x512 window: 35 (34.8007) FPS, 28.7351 ms 1024x1024 window: 22 (21.084) FPS, 47.4293 ms But if I don’t draw chess, then in the window 1366x763: 55 (54.8424) FPS, 18.2341 ms Also, changing the resolution of the shadow map does not greatly affect the FPS. There are 2 point light sources on stage, with FPS loss when drawing this model for each of the passes ~10 FPS (from 23 to 55). Ie, there is no difference where I draw this model: in the depth map or in the "color texture". Losses ~ are the same. I load the model with the following parameters: aiProcess_Triangulate | aiProcess_CalcTangentSpace | aiProcess_JoinIdenticalVertices And render as follows: pointer(cs.inPosition, 3, model.shape->meshes[i].getVerticesBuffer()); pointer(cs.inNormal, 3, model.shape->meshes[i].getNormalsBuffer()); pointer(cs.inTangent, 3, model.shape->meshes[i].getTangentsBuffer()); pointer(cs.inBitangent, 3, model.shape->meshes[i].getBitangentsBuffer()); pointer(cs.inTexCoord, 2, model.shape->meshes[i].getTexCoordsBuffer()); if (model.shape->bonesPerVertex != 0) { pointer(cs.inBoneWeights, 4, model.shape->meshes[i].getBoneWeightsBuffer()); pointerui(cs.inBoneIds, 4, model.shape->meshes[i].getBoneIdsBuffer()); } modelMatrix = &model.transformation; updateMatrices(); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, model.shape->meshes[i].getIndicesBuffer()); glDrawElements(GL_TRIANGLES, model.shape->meshes[i].indices.size(), GL_UNSIGNED_INT, nullptr); Here is the scene itself: I will be grateful for the help!
from GameDev.net http://bit.ly/2WxoN0s
from GameDev.net http://bit.ly/2WxoN0s
ليست هناك تعليقات