I have a script that loads a custom shader in order to achieve a certain effect on my sprites, but I’d like to be able to enable/disable it at will. What would be the proper way to disable it?
I’m currently using a default shader when I want to disable the effects like follows:
varying vec2 v_texCoord;
varying vec4 v_fragmentColor;
void main() {
vec4 textureColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord).rgba;
gl_FragColor = textureColor;
}
Is there a simpler way to go back to the default shader rather than writing my own and using it?