I have been working on a game and encountered a really weird problem. Game renders at round 4k fps on my setup but after drawing a coloured square covering the whole screen + a little more as a background it drops down to 3k fps. Changing the size of the square to a smaller one makes the problem disappear.
Im drawing 40k triangles and particle systems already.
The square is a triangle strip loaded in a VBO.
GLfloat vBackground[4][3] = {
{ 0.0f, 0.0f, 0.0f },
{ 16.0f, 0.0f, 0.0f },
{ 0.0f, 16.0f, 0.0f },
{ 16.0f, 16.0f, 0.0f }
};
Im using the simplest shaders possible:
vertex
#version 140
#extension GL_ARB_explicit_attrib_location : enable
layout (location = 0) in vec4 vVertex;
uniform mat4 mvpMatrix;
uniform vec4 inColor;
varying vec4 color;
void main(void)
{
color = inColor;
gl_Position = mvpMatrix * vVertex;
}
fragment
#version 140
out vec4 vFragColor;
varying vec4 color;
void main(void)
{
vFragColor = color;
}
Is the pixel fill rate of the graphics card just too slow?
4 thousand FPS means it takes you 0.25 milliseconds to render a frame. 3 thousand FPS means it takes you 0.33 milliseconds to render. A total difference of 0.08 milliseconds, or 80 microseconds.
I wouldn’t be worried about it. Your card isn’t “too slow”; you’re too sensitive to minor time differences.