Alexar wrote:i am not quite follow you, but draw things to a canvas with shader, you can deal with canvas more easily.
oh, your code
Code: Select all
vec4 effect(vec4 color, Image texture, vec2 tc, vec2 _)
{
return Texel(texture, tc) * color;
//just return the "color" is what you want...
// Texel(texture, tc)==color if you draw a texture
}
Sorry, following the detail.
I use
https://github.com/vrld/shine, and add a new shader, imitating colorgradesimple, as follow
Code: Select all
extern number grade;
vec4 effect(vec4 color, Image texture, vec2 tc, vec2 _)
{
return vec4(grade, grade, grade, grade) * Texel(texture, tc) * color;
}
Code: Select all
if shader then
shader:draw(function()
DRAW SOMETHING
end)
else
DRAW SOMETHING
end
Grade is change from 0.0 to 1.0 smoothly.
When Grade is equal to or larger than 1.0f, the shader is removed.
I want to keep 'DRAW SOMTHING' looks almost the same after the shader is removed.
However, it changes a lot.
Also i change BlendMode from 'premultiplied' (colorgradesimple, vrld/shine) to 'alpha'.
Does it matter?