<b>This:</b>
game.GameShaderExclude = eShaderExcludeInterfaces -- stops shader effects from affecting interfaces, texts & mouse cursors etc.
and this one:
local eff="ripple1" -- effect name
-- the following lines are to make sure the shader is compiled,
-- a shader is mini program, that needs to be compiled to use it
shaderAddEffect(eff)
shaderRemoveEffect(eff)
-- this is a standard setting, the shader has a variable that is called strength, we set that to 1
shader_effects[eff].num.strength=1
-- also for any animation inside the shader, it needs the time,
-- so we bind the variable time in the shader to our time
bind(eff, "time", field("shader_iTime"))
--[[ that is tricky, it contains the settings for something we could call "effect channel",
like in an audio mixer, send to channel 1 or such.
So we say use the shader "eff" and composition method 5 and 4, list of methods here:
0 GL_ZERO
1 GL_ONE
2 GL_SRC_COLOR
3 GL_ONE_MINUS_SRC_COLOR
4 GL_SRC_ALPHA
5 GL_ONE_MINUS_SRC_ALPHA
6 GL_DST_ALPHA
7 GL_ONE_MINUS_DST_ALPHA
8 GL_DST_COLOR
9 GL_ONE_MINUS_DST_COLOR
10 GL_SRC_ALPHA_SATURATE
the comp dst means what of the destination goes into the equation
and comp src the same for source.
So we use the alpha channel of the source image (GL_SRC_ALPHA)
and for the destination the inverse (GL_ONE_MINUS_SRC_ALPHA).
Destination means our surface, source is the image we are drawing.
If we use GL_ONE, GL_ONE you will see that image is like blended
onto the surface because the colors are added.
]]
shaderSetOptions({{shader = shader_effects[eff].num(), comp_dst=5, comp_src=4 }}, 1)
-- simplest thing of them, set the object "target_object" to the effect channel 1
Objects.sea.ShaderSet = 1