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

Function supportRenderTextureFormat

script.js:191–206  ·  view source on GitHub ↗
(gl, internalFormat, format, type)

Source from the content-addressed store, hash-verified

189}
190
191function supportRenderTextureFormat (gl, internalFormat, format, type) {
192 let texture = gl.createTexture();
193 gl.bindTexture(gl.TEXTURE_2D, texture);
194 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
195 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
196 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
197 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
198 gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 4, 4, 0, format, type, null);
199
200 let fbo = gl.createFramebuffer();
201 gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
202 gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
203
204 let status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
205 return status == gl.FRAMEBUFFER_COMPLETE;
206}
207
208function startGUI () {
209 var gui = new dat.GUI({ width: 300 });

Callers 1

getSupportedFormatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected