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

Author Topic: Shaders?  (Read 1731 times)

0 Members and 1 Guest are viewing this topic.

retep998

  • Newbie
  • *
  • Posts: 17
    • View Profile
Shaders?
« on: January 17, 2010, 07:39:38 am »
I've been messing around with shaders a little and it seems that fragment shaders don't work per fragment of the primitives I draw like in normal OpenGl, but rather apply to the fragments of the framebuffer.
If I want a shader to apply only to a specific primitive, does this mean I have to utilize OpenGL to create shaders?
If so, I have a further question...
Since OpenGL textures are not the same data type as SFML images, how would I get an OpenGL texture out of an image I load?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Shaders?
« Reply #1 on: January 17, 2010, 10:43:51 am »
There are no "general purpose shaders" in SFML 1.x, only post-fx that process the entire framebuffer. However in SFML 2.0 there is a sf::Shader class that you can apply on any SFML drawable, and that you can use directly with your own OpenGL geometry as well.
Laurent Gomila - SFML developer

 

anything