Hello!
I have an interesting problem, maybe it's just my old video card. I'm trying to create a custom font renderer (using sf::Sprite with shaders). The problem is that if I draw 3700 sprite without shaders, it runs at 300-400 FPS, but if I turn on the very basic shaders the FPS drops to 9. The vertex shader does nothing, but on the fragment, I just do some simple calculation.
uniform sampler2D texture;
void main()
{
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);
if(pixel == vec4(1.0, 0.0, 1.0, 1.0))
{
pixel = vec4(vec3(0.0, 0.0, 0.66666), 1.0);
}
else
{
pixel = vec4(vec3(1.0, 1.0, 0.3), 1.0);
}
gl_FragColor = pixel;
}
Any idea? I thought about the lot of texture swap, but then it won't run with 300 - 400 fps without shaders.