improved the rendering pipeline, more optimizations, flags are handled more consistenly