Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sf::Shapes opengl states / batching question  (Read 1573 times)

0 Members and 1 Guest are viewing this topic.

NGM88

  • Full Member
  • ***
  • Posts: 162
    • View Profile
sf::Shapes opengl states / batching question
« on: November 24, 2017, 01:12:42 pm »
I have been grouping my draw calls so that the vertex arrays and sprites that share the same texture atlas are drawn consecutively without needless texture switches. I noticed that some of my drawables also have textureless sf::shapes in them. Do they cause any sort of state change that would cause a state switch? This might be a stupid question since they don't even have textures, just color, but I would like to know if I should separate the shapes  from the group and draw them after the textured drawables?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::Shapes opengl states / batching question
« Reply #1 on: November 24, 2017, 02:43:58 pm »
They do involve state switches, yes, because they obviously do not use the same states (no texture).

If your question is how many states, or if they are expensive to change, then it's nearly impossible to say. At this point you'd better make performance tests -- that's what should drive your entire batching design anyway.
Laurent Gomila - SFML developer

NGM88

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: sf::Shapes opengl states / batching question
« Reply #2 on: November 24, 2017, 07:04:13 pm »
Thanks Laurent!

 

anything