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

Function render

script.js:1296–1317  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

1294}
1295
1296function render (target) {
1297 if (config.BLOOM)
1298 applyBloom(dye.read, bloom);
1299 if (config.SUNRAYS) {
1300 applySunrays(dye.read, dye.write, sunrays);
1301 blur(sunrays, sunraysTemp, 1);
1302 }
1303
1304 if (target == null || !config.TRANSPARENT) {
1305 gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
1306 gl.enable(gl.BLEND);
1307 }
1308 else {
1309 gl.disable(gl.BLEND);
1310 }
1311
1312 if (!config.TRANSPARENT)
1313 drawColor(target, normalizeColor(config.BACK_COLOR));
1314 if (target == null && config.TRANSPARENT)
1315 drawCheckerboard(target);
1316 drawDisplay(target);
1317}
1318
1319function drawColor (target, color) {
1320 colorProgram.bind();

Callers 2

captureScreenshotFunction · 0.85
updateFunction · 0.85

Calls 7

applyBloomFunction · 0.85
applySunraysFunction · 0.85
blurFunction · 0.85
drawColorFunction · 0.85
normalizeColorFunction · 0.85
drawCheckerboardFunction · 0.85
drawDisplayFunction · 0.85

Tested by

no test coverage detected