Could someone with shader experience give some examples of importing a sprite into purebasic and applying glsl shaders to it?
I would like to understand a little more about how shaders work on sprites or 2D images.
Does anyone have examples for learning purposes on importing 2d sprite and applying glsl shader to it?
- skinkairewalker
- Enthusiast
- Posts: 772
- Joined: Fri Dec 04, 2015 9:26 pm
- pf shadoko
- Enthusiast
- Posts: 385
- Joined: Thu Jul 09, 2015 9:07 am
Re: Does anyone have examples for learning purposes on importing 2d sprite and applying glsl shader to it?
viewtopic.php?t=84206&hilit=shader+sprite
there are several shader
go to the corresponding example
the export button (in the editor) saves your shader in the clipboard
don "t know if this has been tested on mac
there are several shader
go to the corresponding example
the export button (in the editor) saves your shader in the clipboard
don "t know if this has been tested on mac
Re: Does anyone have examples for learning purposes on importing 2d sprite and applying glsl shader to it?
There's more to it than this but the gist is:
Change your shader program before drawing your sprite
I think most people don't do it this way and just depend on attributes to change the state of a mega-shader but both ways will involve CPU to GPU uploads so if you're looking for speed to may want to benchmark it.
Change your shader program before drawing your sprite

I think most people don't do it this way and just depend on attributes to change the state of a mega-shader but both ways will involve CPU to GPU uploads so if you're looking for speed to may want to benchmark it.
▓▓▓▓▓▒▒▒▒▒░░░░░