added support for custom texture formats (closes #153, #368)