diff --git a/TODO.md b/TODO.md
index 3047747..ca8ceb1 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,2 +1,6 @@
- fix mouse, add button, drag
+- 3d texture
+ - format
+ - inner format
+ - data from external script
diff --git a/demo/3dt.html b/demo/3dt.html
index 428ecb0..8bdf00a 100644
--- a/demo/3dt.html
+++ b/demo/3dt.html
@@ -25,7 +25,7 @@
-
+
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
vec3 col = texture(tex_avatar, uv).rgb;
diff --git a/demo/3dt.png b/demo/3dt.png
new file mode 100644
index 0000000..c42bd6a
Binary files /dev/null and b/demo/3dt.png differ
diff --git a/src/repa-texture.js b/src/repa-texture.js
index ea65665..68ff306 100644
--- a/src/repa-texture.js
+++ b/src/repa-texture.js
@@ -352,15 +352,15 @@ class RepaTexture extends HTMLElement {
}
get width() {
- return this._width || this.ref?.videoWidth || this.ref?.width || 0;
+ return +(this._width || this.getAttribute("width") || this.ref?.videoWidth || this.ref?.width || 0);
}
get height() {
- return this._height || this.ref?.videoHeight || this.ref?.height || 0;
+ return +(this._height || this.getAttribute("height") || this.ref?.videoHeight || this.ref?.height || 0);
}
get depth() {
- return this._depth || this.ref?.depth || 0;
+ return +(this._depth || this.getAttribute("depth") || this.ref?.depth || 0);
}
get magFilter() {