centralize globals(id counter, scenegraph, current subpath, shader params),remove dead code