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

Author Topic: Where to learn GLSL for sfml?  (Read 3161 times)

0 Members and 1 Guest are viewing this topic.

TheTud69

  • Newbie
  • *
  • Posts: 1
    • View Profile
Where to learn GLSL for sfml?
« on: September 09, 2016, 06:11:41 pm »
The SFML tutorial doesn't cover writing GLSL programs, and I couldn't find any on google that don't try to sink me into the depths of OpenGL. Does anyone have any source/tutorial where can I learn it fast? Only for 2D in sfml, beacause I have no idea how OpenGL looks like

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Where to learn GLSL for sfml?
« Reply #1 on: September 10, 2016, 01:04:18 am »
Why fast?

You don't need to "sink [...] into the depths of OpenGL" to write some shaders. You could look at examples and learn from those as well as constantly looking up references for things you don't understand. This method can be slower overall and you only learn what you find but it can get the initial things up and running quite quickly. You must also expect a lot of trial and error (mostly error) with this method.

The first thing you'll need to realise is that you should probably start from the minimal shaders in the SFML shaders tutorial and build from there. SFML uses some things that aren't present in most shader example, especially newer ones.

There are a couple of shader examples on the SFML wiki and there are some really rather simple shaders here that might help.

Consider also having a look through these:
OpenGL Shader documentation
GLSL on Wikipedia
GLSL tutorial
but note that you most probably will need to use a lower version of the language if used with SFML's Graphics module.

Why do you need shaders, if you don't mind me asking? What are you doing in 2D that you can't do without shaders? Is there a specific shader you need because it might already exist?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything