MCPcopy Index your code
hub / github.com/PavelDoGreat/WebGL-Fluid-Simulation / framebufferToTexture

Function framebufferToTexture

script.js:301–307  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

299}
300
301function framebufferToTexture (target) {
302 gl.bindFramebuffer(gl.FRAMEBUFFER, target.fbo);
303 let length = target.width * target.height * 4;
304 let texture = new Float32Array(length);
305 gl.readPixels(0, 0, target.width, target.height, gl.RGBA, gl.FLOAT, texture);
306 return texture;
307}
308
309function normalizeTexture (texture, width, height) {
310 let result = new Uint8Array(texture.length);

Callers 1

captureScreenshotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected