Hi,
for ( t_it=myTile.begin() ; t_it < myTile.end(); t_it++ )
{
if(viewRect.Intersects((*t_it)->GetTileRect()))
{
value=calculate_value();
myShader.SetParameter("param",value); //dynamic param
myWindow.Draw(*(*t_it)->mySprites[0],myShader);
}
}
Im drawing almost 7000 sprites(16x16), 1680x1050.
If i only draw the sprites, without shader, I have 200/250 FPS (with SFML2).
If I use shader , with SetPArameter outside the loop, a precalculated value for every sprite, I get 140/160 FPS.
IfIi use shader, just like the code, I get 90/100 FPS.
So, I want to know if it is a better way to use dynamic shader(thats the name???).....calling the shader with a dynamic var, using setparameter.
Hope you understand my problem......and my English.
Thanks.
God bless Laurent and his child.