Fixes bug with materials and shader switching

Previously shader switching would fail to setup a new material if the
older material was the same.   This changes that behavior, so that the
material in the shader is set for each render call.