I was wondering if any shader aficionados have any ideas as to whether it’s possible to get an existing shader, and ‘bolt on’ a pixelation effect?
For example, here’s one I’ve grabbed from Shader Toy and converted to Defold. It’s a simple plasma effect:
varying mediump vec2 var_texcoord0;
uniform lowp vec4 shaderTime;
void main()
{
vec2 res = vec2(1.0, 1.0);
vec2 uv = var_texcoord0.xy * res.xy - 0.5;
float sTime = shaderTime.x * 0.5;
float factA = 5.0;
float factB = 7.5;
float varA = (sin(uv.y * factB - sTime)) + sin(uv.x * factA - sTime * 2.0);
float varB = (sin(uv.x * factB - sTime * 2.0)) + sin(uv.y * factA - sTime * 2.0);
gl_FragColor = vec4(uv, uv.y, 1.0) + vec4(varA - 0.5, varA - 0.5, varA + 0.5, 1.0) * vec4(varB - 0.5, varB + 0.3, varB, 1.0) * 0.25;
}
Here’s how it looks:
Here’s how I would like it to look:
I have no idea if this is even possible to add to a shader as it were without modifying the main guts of it, or does the shader need to be rewritten?
Cheers everyone