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

Author Topic: How would sf::Shader work if SFML 3 switched to "modern OpenGL"?  (Read 2472 times)

0 Members and 1 Guest are viewing this topic.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
How would sf::Shader work if SFML 3 switched to "modern OpenGL"?
« on: December 31, 2014, 06:58:52 pm »
I haven't done very much with OpenGL, but my understanding is that if SFML 3 were to use only the "modern" shader-based pipeline instead of the fixed functions it currently uses, it would have to do things like apply a drawable's transform matrix inside a vertex shader and a drawable's (interpolated) color(s) inside a fragment shader.

It seems like this would require SFML to have default shaders and shader parameters as implementation details which users like me would have to know about when using our own shader code.  Does this seem like a problem?  Or is sf::Shader a sufficiently "advanced" feature for that to be a non-issue?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: How would sf::Shader work if SFML 3 switched to "modern OpenGL"?
« Reply #1 on: January 01, 2015, 02:19:30 pm »
It's already the case now with the non-modern OpenGL implementation, because when you use a shader you bypass the corresponding part of the fixed pipeline. The tutorial explains what you have to implement in your shader to make it work as expected by SFML.

To me this is not a problem at all, a shader has to adapt to its inputs.
Laurent Gomila - SFML developer

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: How would sf::Shader work if SFML 3 switched to "modern OpenGL"?
« Reply #2 on: January 01, 2015, 02:30:40 pm »
I think he means something like: How would SFML bind shader attributes to to a drawable's array data.

If we went ahead and made it so that sfml-graphics can still be used shader-less we would have to come up with some attribute naming convention that people would have to use in their shaders as well. Since all the gl_ stuff is reserved and will produce errors, they will probably start with sf_ or something.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).