Added textures support. Still kind of flaky, needs to be optimized.