+void Texture3D::get_level_size(unsigned level, unsigned &w, unsigned &h, unsigned &d) const
+{
+ w >>= level;
+ h >>= level;
+ if(target!=GL_TEXTURE_2D_ARRAY)
+ d >>= level;
+
+ if(!w && (h || d))
+ w = 1;
+ if(!h && (w || d))
+ h = 1;
+ if(!d && (w || h))
+ d = 1;
+}
+
+UInt64 Texture3D::get_data_size() const
+{
+ return id ? width*height*depth*get_pixel_size(storage_fmt) : 0;
+}
+
+
+Texture3D::Loader::Loader(Texture3D &t):
+ DataFile::DerivedObjectLoader<Texture3D, Texture::Loader>(t)
+{
+ init();
+}
+
+Texture3D::Loader::Loader(Texture3D &t, Collection &c):
+ DataFile::DerivedObjectLoader<Texture3D, Texture::Loader>(t, c)
+{
+ init();
+}
+
+void Texture3D::Loader::init()
+{
+ add("raw_data", &Loader::raw_data);
+ add("storage", &Loader::storage);
+ add("storage", &Loader::storage_levels);
+}
+
+void Texture3D::Loader::raw_data(const string &data)
+{
+ obj.image(0, data.data());
+}
+
+void Texture3D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigned d)
+{
+ obj.storage(fmt, w, h, d);
+}
+
+void Texture3D::Loader::storage_levels(PixelFormat fmt, unsigned w, unsigned h, unsigned d, unsigned l)
+{
+ obj.storage(fmt, w, h, d, l);