(target)
| 1329 | } |
| 1330 | |
| 1331 | function 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 | |
| 1350 | function applyBloom (source, destination) { |
| 1351 | if (bloomFramebuffers.length < 2) |
no test coverage detected