You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the batch renderer's submit(...) function takes a lot of time, mainly because of the matrix multiplications. With a little trick I was able to cut down the time (60% to 50%). Here's what I did:
So I'm saving the position, multyply it only once with the matrix, and then keep working with that. Because I don't have a very good computer, without this optimization I got around 3025 FPS. With this I've got almost 3300.
The text was updated successfully, but these errors were encountered:
So the batch renderer's submit(...) function takes a lot of time, mainly because of the matrix multiplications. With a little trick I was able to cut down the time (60% to 50%). Here's what I did:
Maths::vec3f _tpos = *m_TransformationBack * position;
m_Buffer->Position = _tpos;
m_Buffer->TexCoord = texCoords[0];
m_Buffer->TexID = ts;
m_Buffer->Color = c;
m_Buffer++;
_tpos.y += size.y;
m_Buffer->Position = _tpos;
m_Buffer->TexCoord = texCoords[1];
m_Buffer->TexID = ts;
m_Buffer->Color = c;
m_Buffer++;
_tpos.x += size.x;
m_Buffer->Position = _tpos;
m_Buffer->TexCoord = texCoords[2];
m_Buffer->TexID = ts;
m_Buffer->Color = c;
m_Buffer++;
_tpos.y -= size.y;
m_Buffer->Position = _tpos;
m_Buffer->TexCoord = texCoords[3];
m_Buffer->TexID = ts;
m_Buffer->Color = c;
m_Buffer++;
So I'm saving the position, multyply it only once with the matrix, and then keep working with that. Because I don't have a very good computer, without this optimization I got around 3025 FPS. With this I've got almost 3300.
The text was updated successfully, but these errors were encountered: