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

Function initFramebuffers

script.js:982–1010  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

980const displayMaterial = new Material(baseVertexShader, displayShaderSource);
981
982function initFramebuffers () {
983 let simRes = getResolution(config.SIM_RESOLUTION);
984 let dyeRes = getResolution(config.DYE_RESOLUTION);
985
986 const texType = ext.halfFloatTexType;
987 const rgba = ext.formatRGBA;
988 const rg = ext.formatRG;
989 const r = ext.formatR;
990 const filtering = ext.supportLinearFiltering ? gl.LINEAR : gl.NEAREST;
991
992 gl.disable(gl.BLEND);
993
994 if (dye == null)
995 dye = createDoubleFBO(dyeRes.width, dyeRes.height, rgba.internalFormat, rgba.format, texType, filtering);
996 else
997 dye = resizeDoubleFBO(dye, dyeRes.width, dyeRes.height, rgba.internalFormat, rgba.format, texType, filtering);
998
999 if (velocity == null)
1000 velocity = createDoubleFBO(simRes.width, simRes.height, rg.internalFormat, rg.format, texType, filtering);
1001 else
1002 velocity = resizeDoubleFBO(velocity, simRes.width, simRes.height, rg.internalFormat, rg.format, texType, filtering);
1003
1004 divergence = createFBO (simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
1005 curl = createFBO (simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
1006 pressure = createDoubleFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
1007
1008 initBloomFramebuffers();
1009 initSunraysFramebuffers();
1010}
1011
1012function initBloomFramebuffers () {
1013 let res = getResolution(config.BLOOM_RESOLUTION);

Callers 2

script.jsFile · 0.85
updateFunction · 0.85

Calls 6

getResolutionFunction · 0.85
createDoubleFBOFunction · 0.85
resizeDoubleFBOFunction · 0.85
createFBOFunction · 0.85
initBloomFramebuffersFunction · 0.85
initSunraysFramebuffersFunction · 0.85

Tested by

no test coverage detected