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

Function getResolution

script.js:1612–1624  ·  view source on GitHub ↗
(resolution)

Source from the content-addressed store, hash-verified

1610}
1611
1612function getResolution (resolution) {
1613 let aspectRatio = gl.drawingBufferWidth / gl.drawingBufferHeight;
1614 if (aspectRatio < 1)
1615 aspectRatio = 1.0 / aspectRatio;
1616
1617 let min = Math.round(resolution);
1618 let max = Math.round(resolution * aspectRatio);
1619
1620 if (gl.drawingBufferWidth > gl.drawingBufferHeight)
1621 return { width: max, height: min };
1622 else
1623 return { width: min, height: max };
1624}
1625
1626function getTextureScale (texture, width, height) {
1627 return {

Callers 4

captureScreenshotFunction · 0.85
initFramebuffersFunction · 0.85
initBloomFramebuffersFunction · 0.85
initSunraysFramebuffersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected