1
\$\begingroup\$

I discovered VBO's recently and changed my code to use them instead of immediate mode. Now I'm rendering 25000 squares and it's really slowing down my FPS. If I drew all the squares VBO's to an FBO, then bound it to a single VBO, would it increases performance? The 25000 squares is more of a stress test, im trying to optimize my rendering code for snow. Edit : Each snow particle draws one of three static VBO's, this helped performance.

\$\endgroup\$
  • 3
    \$\begingroup\$ You can't bind a VBO to an FBO. For snow, use instancing. \$\endgroup\$ – BWG Feb 18 '15 at 14:12
  • 1
    \$\begingroup\$ compare with how many square you could have drawn without VBOs \$\endgroup\$ – ratchet freak Feb 18 '15 at 14:17
3
\$\begingroup\$

You should have only 1 VBO that contains all of your squares and render it in one single draw call.

Use a texture atlas to combine all your snowflake textures.

Also, look into using a geometry shader to do point sprite expansion, this can reduce your VBO to a single vec4 encoding it as (position.x, position.y, position.z, angle). Have the geometry shader generate the UVs and vertex coordinates from that point+angle.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.