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

Author Topic: Understanding how to create X type of Shader?  (Read 3104 times)

0 Members and 1 Guest are viewing this topic.

SFMLNewGuy

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Understanding how to create X type of Shader?
« on: January 04, 2022, 03:48:08 am »
I just had a quick question? How do people typically figure out different types of shader effects (2D)? Say you want an explosion, or a wind effect, or a fountain? How do people figure this out? Do they just find out the formulas that emulate X type of effect?

Is there a general place where you can find templates of just about anything you can think of? Like a plug-in-play almost where you can fiddle with the variables?

Thanks.

LucasM

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Understanding how to create X type of Shader?
« Reply #1 on: January 04, 2022, 06:18:59 am »
I found some examples online by googling webgl shaders… webgl-shaders.com had a rain effect in the fragment shader.  The other site comes to mind is shadertoy not that I’ve played much with shaders personally.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Understanding how to create X type of Shader?
« Reply #2 on: January 04, 2022, 09:49:25 am »
There are also tons of examples on shadertoys.

You can also do the math to figure out how things need to be moved, but it's usually simpler to just find an example.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/