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

Function initBloomFramebuffers

script.js:1012–1032  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1010}
1011
1012function initBloomFramebuffers () {
1013 let res = getResolution(config.BLOOM_RESOLUTION);
1014
1015 const texType = ext.halfFloatTexType;
1016 const rgba = ext.formatRGBA;
1017 const filtering = ext.supportLinearFiltering ? gl.LINEAR : gl.NEAREST;
1018
1019 bloom = createFBO(res.width, res.height, rgba.internalFormat, rgba.format, texType, filtering);
1020
1021 bloomFramebuffers.length = 0;
1022 for (let i = 0; i < config.BLOOM_ITERATIONS; i++)
1023 {
1024 let width = res.width >> (i + 1);
1025 let height = res.height >> (i + 1);
1026
1027 if (width < 2 || height < 2) break;
1028
1029 let fbo = createFBO(width, height, rgba.internalFormat, rgba.format, texType, filtering);
1030 bloomFramebuffers.push(fbo);
1031 }
1032}
1033
1034function initSunraysFramebuffers () {
1035 let res = getResolution(config.SUNRAYS_RESOLUTION);

Callers 1

initFramebuffersFunction · 0.85

Calls 2

getResolutionFunction · 0.85
createFBOFunction · 0.85

Tested by

no test coverage detected