Shader or Filter sample and tutorial on OpenFL 8

Hi,

I’m trying to upgrade a game to openfl 8 and html5. My goal is to have an overlay effect on a Sprite, like the old blendmode in flash. That I understand it needs to be done with shaders but I’m totally new to shaders and I don’t know where to start. I have tried to find ressources about shaders in openfl 8, some basic samples but found nothing.

Is there some basic samples on how to use shaders in openfl or any tutorial to start ?

Thanks !

You’ve got a ShaderFilter example in here. Have you tried this out? With filter you can apply any effect using shader on the element you apply that filter on:

https://www.openfl.org/blog/2016/10/11/custom-shaders-audiosource-and-more-openfl-4-3-and-lime-3-3-released/

It was back in 4.3 so some things may have changed over the time (I’m not exactly sure) but in general it should be a nice point to start getting to know how this filter works :slight_smile:

Thanks for the link !

I was able to apply a shader as a filter to a Sprite, the given shader didn’t work for me, it may be too old… I’ve used an other one from this thread, a very simple to start.
Then with some tuto about glsl here, and open source overlay shader on github I’ve applied the overlay modifying step by step the simple shader.
It’s still black magic for me but it works :smiley:

1 Like

That’s great to hear :slight_smile: