SFML community forums
Help => Graphics => Topic started by: retep998 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?
-
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.