mirror of
https://github.com/dyuri/repa-shader.git
synced 2025-12-16 11:14:25 +00:00
3d texture from image
This commit is contained in:
parent
73e88916e9
commit
96f41ea6b3
4
TODO.md
4
TODO.md
@ -1,2 +1,6 @@
|
|||||||
- fix mouse, add button, drag
|
- fix mouse, add button, drag
|
||||||
|
|
||||||
|
- 3d texture
|
||||||
|
- format
|
||||||
|
- inner format
|
||||||
|
- data from external script
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<repa-shader id="demoshader" fs-input="fsinput" alpha mouse width=512 height=512>
|
<repa-shader id="demoshader" fs-input="fsinput" alpha mouse width=512 height=512>
|
||||||
<repa-texture src="avatar.png" name="tex_avatar" wrap="mirrored_repeat"></repa-texture>
|
<repa-texture src="avatar.png" name="tex_avatar" wrap="mirrored_repeat"></repa-texture>
|
||||||
<repa-texture t3d name="test3d" filter="nearest"></repa-texture>
|
<repa-texture t3d src="3dt.png" name="test3d" filter="linear" width=32 height=32 depth=32></repa-texture>
|
||||||
void main() {
|
void main() {
|
||||||
vec2 uv = gl_FragCoord.xy / resolution.xy;
|
vec2 uv = gl_FragCoord.xy / resolution.xy;
|
||||||
vec3 col = texture(tex_avatar, uv).rgb;
|
vec3 col = texture(tex_avatar, uv).rgb;
|
||||||
|
|||||||
BIN
demo/3dt.png
Normal file
BIN
demo/3dt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@ -352,15 +352,15 @@ class RepaTexture extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get width() {
|
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() {
|
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() {
|
get depth() {
|
||||||
return this._depth || this.ref?.depth || 0;
|
return +(this._depth || this.getAttribute("depth") || this.ref?.depth || 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
get magFilter() {
|
get magFilter() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user