Your right, it would save lot of time & code-space if this could be accomplished through the shader itself. I, unfortunately, have no idea on how to do this, the replacement thing was my best shot
It can, of course, wait for as long as it has to. Once shader is tweaked, each level can be shadered-up in about 30 minutes.