SFML community forums
Help => Graphics => Topic started by: BaneTrapper on September 02, 2013, 06:16:49 pm
-
Hello.
If an rectangle with (X=0 Y=0 W=10 H=10) is drawn to a window that its position and size is
(X=100, Y=100, W=600, H=400)
Will the object be drawn and use cpu? or is it gonna check if it is in visible screen and not draw it.
-
It will use as much CPU as any other entity, and a little GPU. So if you can easily discard non-visible entities yourself (and your performances need it), then it's a good thing to do.
-
Thank you on lightning fast respond :).
I am just asking that because i drawn 100*100*4+5000*4 vertices that are textures and still getting 600-1200 fps with additional logic thrown in that mix and i am very surprised on that performace.
And most of them go out of screen so i was just wondering.
-
Modern GPUs have optimized codepaths/hardware for culling invisible objects. However, if you pre-cull on CPU side, you'll save yourself the (probably small) bandwidth overhead of sending the vertex data to the GPU every frame.