MCPcopy Create free account
hub / github.com/gpujs/gpu.js / renderRawOutput

Method renderRawOutput

src/backend/gl/texture/float.js:12–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 this.type = 'ArrayTexture(1)';
11 }
12 renderRawOutput() {
13 const gl = this.context;
14 const size = this.size;
15 gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer());
16 gl.framebufferTexture2D(
17 gl.FRAMEBUFFER,
18 gl.COLOR_ATTACHMENT0,
19 gl.TEXTURE_2D,
20 this.texture,
21 0
22 );
23 const result = new Float32Array(size[0] * size[1] * 4);
24 gl.readPixels(0, 0, size[0], size[1], gl.RGBA, gl.FLOAT, result);
25 return result;
26 }
27 renderValues() {
28 if (this._deleted) return null;
29 return this.renderRawOutput();

Callers 3

renderValuesMethod · 0.95

Calls 1

framebufferMethod · 0.80

Tested by

no test coverage detected