MCPcopy
hub / github.com/PavelDoGreat/WebGL-Fluid-Simulation / drawDisplay

Function drawDisplay

script.js:1331–1348  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

1329}
1330
1331function drawDisplay (target) {
1332 let width = target == null ? gl.drawingBufferWidth : target.width;
1333 let height = target == null ? gl.drawingBufferHeight : target.height;
1334
1335 displayMaterial.bind();
1336 if (config.SHADING)
1337 gl.uniform2f(displayMaterial.uniforms.texelSize, 1.0 / width, 1.0 / height);
1338 gl.uniform1i(displayMaterial.uniforms.uTexture, dye.read.attach(0));
1339 if (config.BLOOM) {
1340 gl.uniform1i(displayMaterial.uniforms.uBloom, bloom.attach(1));
1341 gl.uniform1i(displayMaterial.uniforms.uDithering, ditheringTexture.attach(2));
1342 let scale = getTextureScale(ditheringTexture, width, height);
1343 gl.uniform2f(displayMaterial.uniforms.ditherScale, scale.x, scale.y);
1344 }
1345 if (config.SUNRAYS)
1346 gl.uniform1i(displayMaterial.uniforms.uSunrays, sunrays.attach(3));
1347 blit(target);
1348}
1349
1350function applyBloom (source, destination) {
1351 if (bloomFramebuffers.length < 2)

Callers 1

renderFunction · 0.85

Calls 2

getTextureScaleFunction · 0.85
bindMethod · 0.45

Tested by

no test coverage detected