Spaces:
Sleeping
Sleeping
Download backend/libs/three/renderers/WebGLMultipleRenderTargets.js from k-l-lambda/starry: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/spaces/k-l-lambda/starry/resolve/main/backend/libs/three/renderers/WebGLMultipleRenderTargets.js
- Command line
-
hf download hf://spaces/k-l-lambda/starry/backend/libs/three/renderers/WebGLMultipleRenderTargets.js
-
curl -L -o WebGLMultipleRenderTargets.js https://huggingface.co/spaces/k-l-lambda/starry/resolve/main/backend/libs/three/renderers/WebGLMultipleRenderTargets.js
1.46 kB
| import { WebGLRenderTarget } from './WebGLRenderTarget.js'; | |
| class WebGLMultipleRenderTargets extends WebGLRenderTarget { | |
| constructor(width, height, count) { | |
| super(width, height); | |
| const texture = this.texture; | |
| this.texture = []; | |
| for (let i = 0; i < count; i++) { | |
| this.texture[i] = texture.clone(); | |
| } | |
| } | |
| setSize(width, height, depth = 1) { | |
| if (this.width !== width || this.height !== height || this.depth !== depth) { | |
| this.width = width; | |
| this.height = height; | |
| this.depth = depth; | |
| for (let i = 0, il = this.texture.length; i < il; i++) { | |
| this.texture[i].image.width = width; | |
| this.texture[i].image.height = height; | |
| this.texture[i].image.depth = depth; | |
| } | |
| this.dispose(); | |
| } | |
| this.viewport.set(0, 0, width, height); | |
| this.scissor.set(0, 0, width, height); | |
| return this; | |
| } | |
| copy(source) { | |
| this.dispose(); | |
| this.width = source.width; | |
| this.height = source.height; | |
| this.depth = source.depth; | |
| this.viewport.set(0, 0, this.width, this.height); | |
| this.scissor.set(0, 0, this.width, this.height); | |
| this.depthBuffer = source.depthBuffer; | |
| this.stencilBuffer = source.stencilBuffer; | |
| this.depthTexture = source.depthTexture; | |
| this.texture.length = 0; | |
| for (let i = 0, il = source.texture.length; i < il; i++) { | |
| this.texture[i] = source.texture[i].clone(); | |
| } | |
| return this; | |
| } | |
| } | |
| WebGLMultipleRenderTargets.prototype.isWebGLMultipleRenderTargets = true; | |
| export { WebGLMultipleRenderTargets }; | |