Texture system rewritten and framebuffers modified to support custom depth buffers