patched rendering for emscripten compatibility